一个非常好用的Android流式布局

本文介绍如何在Android项目中实现流式布局,并详细讲解了如何设置标签的文字大小、颜色及背景,包括默认状态和点击状态的背景设置。同时提供了.java文件的完整内容并以注释方式解释,以便读者理解和实现。最后,作者提供了联系方式以解答读者疑问,希望对读者有所帮助。
摘要由CSDN通过智能技术生成

效果图镇楼
这里写图片描述
首先我们先添加依赖

compile 'com.zhy:flowlayout-lib:1.0.3'

然后将以下标签和布局添加到项目中。
主布局layouy->activity_flow_layout.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:zhy="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_flow_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context="wswy.mymob.FlowLayout">
<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="完善属性信息,获取更高贷款额度"
    />

    <com.zhy.view.flowlayout.TagFlowLayout
        android:id="@+id/id_flowlayout"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:padding="20dp"
        zhy:max_select="-1"
        >
    </com.zhy.view.flowlayout.TagFlowLayout>
</
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值