首页 头条 财经 产业 金融 投融 股证 财报 数链 English
首页 / 金融财报 / 正文

描述距离的控件layout_margintop即两个控件最小距离

来源:
编辑:电经淘讯
时间:2025-06-23

首先,需要明确的是,RelativeLayout 是相对布局,这意味着其中的所有控件如果不进行具体的位置确定,都将汇集在左上角。layout_marginTop:根据这个名字,我们也可以知道,它指的是该属性所在控件的边缘与上部控件的边缘的距离,这里的边缘是最靠近的边缘,即两个控件之间的最小距离,这里是该控件的上部边缘与父控件的下部边缘。


<?xml version="1.0" encoding="utf-8"?>
      <RelativeLayout xmlns:android="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>

财经视野更多
经济视界更多

中信证券、华创证券、招商证券、申港证

   11月20日,各地证监局披露多张罚单,覆盖5家券...[详细]

欢聚集团Q3总收入达6.246亿美元 同比增

北京时间2026年11月19日,欢聚集团发布2026年第三季度财报,集团...[详细]

热点财经更多
  • CopyRight @ 2013-2026 Reserved CN电商经济网版权所有所涉内容免责声明查阅