1
我想要的布局是屏幕大两行三列如何在xml中做这样的布局? Android的
这样的图像=> http://dl.dropbox.com/u/2024237/Bildschirmfoto-DroidDraw.png
的颜色应该是按钮...
请帮助。 ...我不知道它
我想要的布局是屏幕大两行三列如何在xml中做这样的布局? Android的
这样的图像=> http://dl.dropbox.com/u/2024237/Bildschirmfoto-DroidDraw.png
的颜色应该是按钮...
请帮助。 ...我不知道它
使用LinearLayouts并设置孩子fill_parent的宽度和高度,并指定他们相同的layout_weight你会得到所需的效果:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<LinearLayout
android:orientation="horizontal"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<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>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<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>
</LinearLayout>
</LinearLayout>
真棒谢谢你=) – 2010-07-25 20:43:30