回答
只需添加:
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
他们两个。相等的layout_weight
参数均匀分配空间量。
上接受一些答案到你前面的问题,以及工作。
检查这个例子可以帮助你。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/rootlinearlayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:id="@+id/linearlayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:orientation="vertical">
<EditText
android:id="@+id/et01"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="First TextBox"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/linearlayout02"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:orientation="vertical">
<EditText
android:id="@+id/et02"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Another TextBox"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>
嗨,感谢您的答复,我想分成垂直的两个画面,我用你的代码中,“AnotherTextbox”是“第一个文本框”后非常快到了,我想50%的第一和50 %到second.Any建议? – ramsbh 2010-11-22 08:54:27
在两个EditText中尝试android:layout_height =“match_parent”。这应该很好。 – 2010-11-22 09:17:42
正常情况下,我使用android:layout_weight =“1”。你也可以使用表格布局。
我们可以使用 android:layout_width="0dp"
和 android:layout_weight="1"
两个片段 的和这些家长,我们可以使用android:layout_width="fill_parent"
- 1. 垂直分割布局Android
- 2. android显示切割的布局EditText
- 3. 分割PHP阵列的网格布局
- 4. Android布局对角线切割
- 5. 默认分割窗口布局
- 6. 谷歌地图分割布局
- 7. 使用RelativeLayout来均匀分割布局
- 8. 50%分割布局与图像
- 9. Android百分比布局
- 10. 在相对布局中对布局的权利分配 - android,
- 11. 的Android:布局
- 12. 布局的Android
- 13. Android layoutdisplay,布局布局。
- 14. Android:相对布局布局
- 15. Android布局 - 位置布局
- 16. Android简单的百分比布局?
- 17. 带到android的前面部分布局
- 18. Android Nougat的相对布局百分比
- 19. 的Android百分比宽度布局
- 20. Android的布局中的布局设计
- 21. Android的布局问题 - 分离屏幕分成两个布局(选项卡内)
- 22. Android布局文件夹:布局,布局端口,布局区域
- 23. 当我分割xml布局时呈现的视图不同
- 24. 布局置换的Android布局
- 25. Android中的布局
- 26. 的Android(表布局)
- 27. Android的布局priotity
- 28. Android中的布局?
- 29. 的Android表布局
- 30. Android的布局V14
刚刚看了您的回复答案。让我知道..你想如何划分他们?垂直(堆叠在彼此的顶部)或水平(出现在彼此的侧面)? – kishu27 2012-03-23 12:20:13