简体   繁体   English

android:如何在tablelayout上方(屏幕和tablelayout之间)实现顶部空间

[英]android: How to achieve space on the top above the tablelayout(between screen and tablelayout)

I am not able to upload the image to help me better. 我无法上传图片以帮助我更好。

How to acheive space on the top of the tablelayout (ie)between the screen and the tablelayout. 如何在屏幕和桌面布局之间的桌面布局(例如)上获得空间。 The table below is beginning without any space between the table and screen. 下表是开头,表格和屏幕之间没有任何空格。

<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>
  .................
    ........

Margins for a view are used by its container to position the view itself. 视图的边距由其容器用来定位视图本身。 Just include the TableLayout in a LinearLayout, and the latter will correctly add the margin. 只需将TableLayout包含在LinearLayout中,后者就会正确添加边距。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM