簡體   English   中英

如何在 TableLayout 中創建一個空的 TableRow

[英]How To Create an Empty TableRow in TableLayout

我的安卓應用程序有以下布局。

<?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,但這沒有用。

像大多數視圖一樣,表格行具有paddingTop ,只需使用它

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM