merge标签

merge标签的作用是再自定义布局中,或需要被include引用的布局中,减少布局的层级

例如下列代码,使用了merge,则button外层不会自动生成一个父布局(RelativeLayout)

<merge xmlns:android="http://schemas.android.com/apk/res/android">
    <Button
        android:id="@+id/title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="哈哈哈" />
 </merge>

猜你喜欢

转载自blog.csdn.net/weixin_38617084/article/details/88953880
今日推荐