如何在TableLayout中创建空TableRow?
我的 Android 应用程序有以下布局。
<?xml version="1.0" encoding="utf-8"?>
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/ULC Background"
android:stretchColumns="1">
<!--Below I try to create an 'empty' table to push down the buttons 200 pixels, but it doesn't work, it doesn't affect the layout at all-->
<TableRow android:id="@+id/tableRow3" android:layout_width="fill_parent" android:layout_height="200dip"></TableRow>
<TableRow android:layout_height="wrap_content" android:id="@+id/tableRow1" android:layout_width="wrap_content">
<Button android:text="@string/startButtonText" android:layout_width="wrap_content" android:id="@+id/button1" android:layout_height="wrap_content"></Button>
</TableRow>
<TableRow android:layout_height="wrap_content" android:id="@+id/tableRow2" android:layout_width="wrap_content">
<Button android:text="@string/exitButtonText" android:layout_width="wrap_content" android:id="@+id/button2" android:layout_height="wrap_content"></Button>
</TableRow>
</TableLayout>
顶部的按钮看起来很奇怪,我希望它们向下推 200 像素,那么我该怎么做呢?
我尝试创建一个“空”TableRow,但这不起作用。
I have the following layout for my android app.
<?xml version="1.0" encoding="utf-8"?>
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/ULC Background"
android:stretchColumns="1">
<!--Below I try to create an 'empty' table to push down the buttons 200 pixels, but it doesn't work, it doesn't affect the layout at all-->
<TableRow android:id="@+id/tableRow3" android:layout_width="fill_parent" android:layout_height="200dip"></TableRow>
<TableRow android:layout_height="wrap_content" android:id="@+id/tableRow1" android:layout_width="wrap_content">
<Button android:text="@string/startButtonText" android:layout_width="wrap_content" android:id="@+id/button1" android:layout_height="wrap_content"></Button>
</TableRow>
<TableRow android:layout_height="wrap_content" android:id="@+id/tableRow2" android:layout_width="wrap_content">
<Button android:text="@string/exitButtonText" android:layout_width="wrap_content" android:id="@+id/button2" android:layout_height="wrap_content"></Button>
</TableRow>
</TableLayout>
The buttons look really weird right at the top,and I want them pushed down 200 pixels, so how can I do that?
I tried creating an 'empty' TableRow, but that didn't work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
与大多数视图一样,表格行具有 paddingTop ,只需使用它
Table rows have paddingTop like most views, just use that