FlowLayout

博客介绍了Android的FlowLayout,它可在空间不足时让子视图自动换行,还能自动计算子视图间距使视图均匀分布。同时提及了Gradle、使用方法和属性等内容,项目地址为nex3z/FlowLayout。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

FlowLayout

项目地址:nex3z/FlowLayout 

简介:A flow layout for Android with auto-spacing.

A FlowLayout for Android, which allows child views flow to next row when there is no enough space. The spacing between child views can be calculated by the FlowLayout so that the views are evenly placed.

Gradle

compile 'com.nex3z:flow-layout:1.2.2'

Usage

<com.nex3z.flowlayout.FlowLayout
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:flChildSpacing="auto"
    app:flChildSpacingForLastRow="align"
    app:flRowSpacing="8dp">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="SUN"/>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="MON"/>

    <!--...-->

</com.nex3z.flowlayout.FlowLayout>

Attributes

AttributeFormatDescription
flFlowbooleantrue to allow flow. false to restrict all child views in one row. The default is true.
flChildSpacingauto/dimensionThe horizontal spacing between child views. Either auto, or a fixed size. The default is 0dp.
flChildSpacingForLastRowauto/align/
dimension
The horizontal spacing between child views of the last row. Either autoalign or a fixed size. If not set, childSpacing will be used instead.
flRowSpacingauto/dimensionThe vertical spacing between rows. Either auto, or a fixed size. The default is 0dp.
flRtlbooleantrue to layout child views from right to left. false to layout from left to right. The default is false.
flMaxRowsintegerThe maximum height of FlowLayout in terms of number of rows.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值