您需要的布局称为FlowLayout。但是android SDK目前不支持这种布局。有很多不错的第三方库可用,其中之一就是FlowLayout。
摇篮:
compile 'com.wefika:flowlayout:0.4.1'
在您的布局中:
<com.wefika.flowlayout.FlowLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="start|top">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Lorem ipsum" />
</com.wefika.flowlayout.FlowLayout>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句