Android简单布局优化1

来源:互联网 发布:淘宝装修模板市场 编辑:程序博客网 时间:2024/06/06 06:45

<!-- 借助merge元素标签实现布局(相同的根元素)的合并(说明:merge只能作为根标签出现)。-->

<!-- 此布局对应的view对象会添加到activity对应的window窗口(PhoneWindow) -->

<merge
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">
    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Btn-01"/>
    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Btn-02"
        android:layout_gravity="right"/>
</merge>


0 0