0
A
回答
2
可能有这样做的更好的办法,其实我以前没有使用过TableLayout,但是下面的XML给出你要的基本布局:
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_span="4"
android:layout_weight="1"
android:text="Text"
android:gravity="center" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:text="Text" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_span="3"
android:layout_weight="0.75"
android:text="Text that is longer than other cells" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:text="Text" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:text="Text" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:text="Text" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:text="Text" />
</TableRow>
</TableLayout>
+0
谢谢你。它的工作好:) – venni 2013-04-13 15:41:42
0
用心棒,你是对的,但是如果您使用
安卓layout_weight
你必须记住有关更换(在这种特殊情况下)的android:layout_width =” WRAP_CONTENT “与
机器人:layout_width =” 0dp“。
Here你有一个很好的参考。
相关问题
- 1. Android中标签布局中的表格布局
- 2. Android:表格布局对齐
- 3. Android全屏表格布局
- 4. Android复杂表格布局
- 5. Android应用中的表格布局
- 6. 在android中的表格布局
- 7. Android中的表格布局问题?
- 8. Android中的表格布局安排
- 9. Xamarin中的表格布局Android
- 10. Android中的动态表格布局?
- 11. 相对布局中的表格布局
- 12. 在Android中设置表格布局
- 13. java中的表格布局
- 14. 表格布局中的表格阵列
- 15. 表格中固定的表格布局
- 16. 如何删除表格布局在Android中的表格行
- 17. 在android中的表格布局底部显示表格
- 18. 表格布局麻烦。新的android
- 19. 使用表格的Android布局
- 20. Android的表格布局无边距
- 21. Android网格布局
- 22. 的Android(表布局)
- 23. 的Android表布局
- 24. Android上的网格布局?
- 25. 的Android V7网格布局
- 26. Instagram风格的android布局?
- 27. Android的布局格式
- 28. 嵌套在滚动视图中的布局(其中一个表格布局) - Android?
- 29. 如何在android中为表格布局实现表格边框
- 30. J2ME中的表格或网格布局
我认为表格布局应该做的一部分是给你排列的列。你想要列不排队。我不确定它是否适合你。 – HalR 2013-04-11 02:12:34