У меня есть некоторые проблемы с использованием того же текстового вида с разным текстом в том же действии. У меня есть фрагмент, называемый listGrade. В своем onCreateView методе я получаюИспользуйте тот же textView в том же действии с разным текстом
View rootView = inflater.inflate(R.layout.fragment_list_grade, container, false);
TextView textViewww = (TextView) rootView.findViewById(R.id.Number);
textViewww.setText(test1);
Я хочу, чтобы, создать TextView снова из XML-файла и
textViewww.setText(test2);
в конце мой взгляд имеет два TextView с другим текстом. Как я могу достичь?
fragment_list_grade.xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/llayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ScrollView
android:id="@+id/layout"
android:layout_height="wrap_content"
android:scrollbars="horizontal|vertical"
android:layout_width="match_parent"
android:layout_marginTop="5dip"
android:scrollbarStyle="outsideInset"
android:fillViewport="true">
<HorizontalScrollView
android:id="@+id/horizontalView"
android:layout_height="wrap_content"
android:scrollbars="horizontal|vertical"
android:layout_width="wrap_content"
android:layout_marginTop="5dip">
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/tableLay"
android:background="#ffffff">
<TableRow
android:id="@+id/tableRow1"
android:layout_height="wrap_content"
android:layout_width="match_parent">
<TextView
android:id="@+id/Number"
android:text="Row 2 column 1"
android:layout_weight="1"
android:background="#dcdcdc"
android:textColor="#000000"
android:padding="20dip"
android:gravity="center"/>
</TableRow>
</TableLayout>
</HorizontalScrollView>
</ScrollView>
</LinearLayout>
с какой проблемой вы сталкиваетесь? –
Я хочу этого, потому что у меня неизвестное количество текстов из веб-сервисов. Я должен создать textView динамически с таким же внешним видом. – guneraykut
просто раздуйте текстовое изображение на ваш взгляд – duggu