Layout布局之帧布局

将所有的子元素放在整个界面的左上角,后面的子元素直接覆盖前面的子元素,所以用的比较少。

在以后用到碎片的时候用的多,多用于占位

通过代码可以很清楚了解所以就不过多用文字介绍

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"<img src="https://img-blog.youkuaiyun.com/20160918221403210?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" align="right" width="300" height="400" alt="" />
    android:layout_height="match_parent"
     >

    <TextView
        android:layout_gravity="center"
        android:layout_width="300dp"
        android:layout_height="300dp"
        android:background="#000000"
      />
    <TextView
        android:layout_gravity="center"
        android:layout_width="200dp"
        android:layout_height="200dp"
        android:background="#ff0000"
       />
    <TextView
        android:layout_gravity="center"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#00ff00"
        />

</FrameLayout>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值