android 重叠view 重叠布局

情到浓时终转凉″ 提交于 2019-11-27 01:38:25

使用RelativeLayout即可实现重叠布局——RelativeLayout标签内容里面的下层布局会浮现在上层布局之上;上层布局会被下层布局覆盖

 

实现layout:

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="200dp"
    android:background="#FFE4C4">

    <LinearLayout
        android:layout_width="300dp"
        android:layout_height="100dp"
        android:background="#303F9F"></LinearLayout>
    <LinearLayout
        android:layout_width="200dp"
        android:layout_height="100dp"
        android:background="#FF4081"
        android:layout_marginLeft="50dp"
        android:layout_marginTop="50dp"></LinearLayout>
</RelativeLayout>

 

实现效果:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!