Ich bin neu bei Android.Ich habe Tabellenlayout in XML und dynamisch Zeilen hinzufügen, ich versuche dynamische Zeilen in scrollview.please jemand Hilfe, wie zu tun.wie scrollview dynamisch zu dynamischen Tabellenzeilen hinzufügen
Hier mein xml:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
<include layout="@layout/header"
android:id="@+id/header" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/tv_message"
android:textSize="18sp"
android:textAlignment="center"
android:background="#deb8"
android:layout_below="@id/header"
android:textColor="#000000"
android:text="Please Confirm the Quote and check for Errors "/>
<ScrollView
android:id="@+id/ScrollView03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_message" >
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_message"
android:id="@+id/table_orderfulfillment"
android:stretchColumns="*">
</TableLayout>
</ScrollView>
</Relative Layout>
Anstatt ein TableLayout zu verwenden, können Sie ein RecyclerView als Raster verwenden, um Informationen anzuzeigen und das Elementlayout anzupassen. Siehe gutes Beispiel hier: http://blog.sqisland.com/2014/12/recyclerview-grid-with-header.html – Alexandre
Gutes Beispiel hier auch: http://stackoverflow.com/questions/40587168/simple-android- grid-example-using-recyclerview-mit-gridlayoutmanager-like-the- – Alexandre