2013-07-30 37 views
0

我有一個表TabView的列

<TableLayout 
android:id="@+id/branchTable" 
android:layout_width="fill_parent" 
android:layout_height="match_parent" 
android:layout_below="@+id/EditTextSubHeading" 
android:layout_margin="10dp" 
android:collapseColumns="30sp" > 
</TableLayout> 

我要適合所有的列根據屏幕size.Mean如果我有一個標籤 10.1" 和我有5個列中的每個列應採取10.1"/5

回答

0

添加以下代碼到你的tablelayout:

android:stretchColumns="*" 
android:shrinkColumns="*" 

這意味着所有列都能夠收縮和伸展。 Android將處理如何爲所有列分配好空間。通過在上面的代碼中設置數字,您還可以指定想要拉伸或縮小的列。