0

画像をアップロードして改善することができません。

テーブルレイアウトの上部 (つまり、画面とテーブルレイアウトの間) にスペースを確保する方法。下の表は、表と画面の間にスペースを空けて始めています。

<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/my_shape_file"
android:layout_alignParentRight="true" 
android:layout_marginTop="10dip"
android:stretchColumns="3">

 <TableRow>

        <TextView
            android:layout_column="1"
            android:gravity="left"            
            android:background="@drawable/todayhr"/>


        <TextView
            android:layout_column="2"
            android:text="one"
            android:gravity="center"
            android:textColor="#000000" />
    </TableRow>



  <View
    android:layout_height="1dip"
    android:layout_width="wrap_content"
    android:background="#ABABAB" />

  <tablerow>
  .................
    ........
4

1 に答える 1

0

ビューの余白は、コンテナによってビュー自体を配置するために使用されます。TableLayoutを LinearLayout に含めるだけで、後者はマージンを正しく追加します。

于 2012-05-01T20:22:44.670 に答える