android - Is there any way to make table columns equal to a fraction of the total width? -
so far in learning have come across spreading column sizes equally, giving one/two higher priority take space need, or setting size of column manually.
i wondering if there anyway of setting column size in android fraction of total table size. want split sixths. 1/6 first column, 3/6 second column , 2/6 third.
is there way this?
you can using android:layout_span
here example :
<?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="*"> <tablerow android:layout_width="fill_parent" android:layout_height="fill_parent"> <textview android:background="#aa0000" android:text="1/6" android:gravity="center_horizontal"/> <textview android:background="#00aa00" android:text="3/6" android:gravity="center_horizontal" android:layout_span="3"/> <textview android:background="#0000aa" android:text="2/6" android:gravity="center_horizontal" android:layout_span="2"/> </tablerow> </tablelayout>
Comments
Post a Comment