开发者

How to inline wrap layouts?

开发者 https://www.devze.com 2023-04-08 17:17 出处:网络
How do we make inline layouts in Android? Something like this: I tried using margin right in Relative layouts but they are separated into 2 columns instead of wrapping each other:

How do we make inline layouts in Android?

Something like this:

How to inline wrap layouts?

I tried using margin right in Relative layouts but they are separated into 2 columns instead of wrapping each other:

<RelativeLayout
    android:id="@+id/Container"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <RelativeLayout
            android:id="@+id/Layout1"
            android:layout_width=开发者_高级运维"fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginRight="60sp">
            .... //something here
    </RelativeLayout>
    <RelativeLayout
            android:id="@+id/Layout2"
            android:layout_width="60sp"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true">
             .... //something here
    </RelativeLayout>
</RelativeLayout>


Layout2 have width 60dp and in layout1 you are putting margin to 60dp so that they looks like a two column If you want to check it change margin of layout1 to 30dp you will see that wrapping effect and also put some controls inside layouts so that you can see the area

0

精彩评论

暂无评论...
验证码 换一张
取 消