Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Simple flow layout for android. 适用于Android平台的简单的FlowLayout

License

Notifications You must be signed in to change notification settings

daemon369/FlowLayout

Repository files navigation

FlowLayout

自适应标签容器,支持标签自动换行,支持设置标签水平间距、垂直间距,支持设置最大行数

Download


效果

Demo效果


使用方法

1. 项目中引入依赖:

项目根目录下build.gradle中加入:

allprojects {
 repositories {
 ...
 jcenter()
 }
}

添加依赖:

dependencies {
 implementation 'me.daemon:flowlayout:0.1.0'
}

2. 布局文件中引用:

可以在布局中直接引用:

<FrameLayout
 xmlns:android="http://schemas.android.com/apk/res/android"
 xmlns:app="http://schemas.android.com/apk/res-auto"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:padding="10dp">
 <me.daemon.flowlayout.FlowLayout
 android:layout_width="match_parent"
 android:layout_height="wrap_content"
 android:background="#4bd144"
 android:padding="5dp"
 app:daemon_fl_horizontal_divider_size="5dp"
 app:daemon_fl_max_rows="1"
 app:daemon_fl_vertical_divider_size="5dp">
 <TextView
 android:layout_width="50dp"
 android:layout_height="30dp"
 android:background="@drawable/bg_label"
 android:text="testtestjustt...." />
 <Button
 android:layout_width="wrap_content"
 android:layout_height="50dp"
 android:background="@drawable/bg_label"
 android:text="测试测试测试" />
 <ImageView
 android:layout_width="40dp"
 android:layout_height="40dp"
 android:background="@drawable/bg_label"
 android:src="@mipmap/ic_launcher"
 android:visibility="gone" />
 <TextView
 android:layout_width="90dp"
 android:layout_height="wrap_content"
 android:background="@drawable/bg_label"
 android:text="falefffffffeaf" />
 <ImageView
 android:layout_width="40dp"
 android:layout_height="40dp"
 android:background="@drawable/bg_label"
 android:src="@mipmap/ic_launcher"
 android:visibility="gone" />
 <TextView
 android:layout_width="wrap_content"
 android:layout_height="70dp"
 android:background="@drawable/bg_label"
 android:text="............................................" />
 </me.daemon.flowlayout.FlowLayout>
</FrameLayout>

About

Simple flow layout for android. 适用于Android平台的简单的FlowLayout

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

AltStyle によって変換されたページ (->オリジナル) /