android - Problems with alignment of listview item -
android - Problems with alignment of listview item -
i have problem alignment of various fields in each row of listview . know how go b under b , c under c , etc. ..
thanks !!
since can not post screenshot , seek create image
aaaaaaa bbbbbb cccccc dddddd (this title) aaa bbb ccc ddd (this listview item)
how can align it?
i recommend utilize of tables things this. can define layout set every row in listview. row have 4 parts same width , should equals each other in same row , in different rows along list view.
<?xml version="1.0" encoding="utf-8"?> <tablelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:stretchcolumns="*" android:weightsum="4" > <tablerow android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" > <textview android:id="@+id/aaaaaaa" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" /> <textview android:id="@+id/bbbbbbbb" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" /> <textview android:id="@+id/cccccccc" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" /> <textview android:id="@+id/dddddddd" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" /> </tablerow> </tablelayout>
you can set style there , whatever want...
i hope help!!
android listview alignment
Comments
Post a Comment