用途
让布局里的控件自动换行
效果图
![](https://img.haomeiwen.com/i6169789/c83eb1ea6bde7e17.png)
使用方法
- 添加依赖
implementation 'com.nex3z:flow-layout:1.3.1'
- 代码
<com.nex3z.flowlayout.FlowLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="@drawable/shape_rec_blue"
android:padding="10dp"
android:text="@string/test" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="@drawable/shape_rec_blue"
android:padding="10dp"
android:text="@string/test" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="@drawable/shape_rec_blue"
android:padding="10dp"
android:text="@string/test" />
</com.nex3z.flowlayout.FlowLayout>
网友评论