2012-05-01 6 views
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> 
    ................. 
    ........ 

答えて

0

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

+0

ありがとうございます!出来た。 – samdroid

関連する問題