首页 聚焦 财经 产业 证券 股市 商业 民生 IPO 点评 IPhone客户端 安卓客户端
首页/中企财报

4

控制控件到边框的距离做好页面布局layout_margintop
2021-08-18

layout_marginTop,layout_marginBottom,layout_marginRight,layout_marginLeft是 RelativeLayout 中的四种属性。

layout_marginTop 指定该属性所在控件距上部最近控件的最小值;
layout_marginBottom 指定该属性所在控件距下部最近控件的最小值;
layout_marginLeft 指定该属性所在控件距左边最近控件的最小值;
layout_marginRight 指定该属性所在控件距右边最近控件的最小值。
layout_marginTop使用方法:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="match_parent"
      android:layout_height="match_parent">
    <Button android:id="@+id/project"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="项目"
        android:layout_marginTop="50dp"/>
</RelativeLayout>

声明:登载此文出于传递更多信息之目的,文章内容仅供参考,读者据此操作风险自担。
点赞
编辑:中证
中证新闻网
中证新闻网
中证点评更多

  有数据表明,截止2020年,国内吃辣的消费者已超...[详细]

  “我们家一直都是雅迪冠能系列的忠实粉丝,...[详细]

民生经济更多
中证新闻网
科创板块更多
热搜汇聚更多
  • 合作: 友情链接商务洽谈联系方式
  • Email:107308649@qq.com
  • CopyRight@2008-2022 中国证券新闻网 All Right Reserved

    工信备案号:备案号京ICP(备)15095275

    中国证券新闻网版权所有违者必究