我想要一個與屏幕一樣大的布局,有兩行三列
like that image => http://dl.dropbox.com/u/2024237/Bildschirmfoto-DroidDraw.png
顏色應該是按鈕......
請幫助......我無法弄明白
我想要一個與屏幕一樣大的布局,有兩行三列
like that image => http://dl.dropbox.com/u/2024237/Bildschirmfoto-DroidDraw.png
顏色應該是按鈕......
請幫助......我無法弄明白
使用LinearLayouts並在寬度和高度上將子設置為fill_parent,並為它們分配相同的layout_weight,您將獲得所需的效果:
<?xml version="1.0" encoding="utf-8"?>
<button
android:text="Button 1"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"></button>
<button
android:text="Button 2"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"></button>
<button
android:text="Button 3"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"></button>
<button
android:text="Button 4"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"></button>
<button
android:text="Button 5"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"></button>
<button
android:text="Button 6"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"></button>