繁体   English   中英

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

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

我无法上传图片以帮助我更好。

如何在屏幕和桌面布局之间的桌面布局(例如)上获得空间。 下表是开头,表格和屏幕之间没有任何空格。

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

视图的边距由其容器用来定位视图本身。 只需将TableLayout包含在LinearLayout中,后者就会正确添加边距。

暂无
暂无

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

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