Android开源库-用于显示标签的流式布局
来源:互联网 发布:死亡天使蘑菇 淘宝 编辑:程序博客网 时间:2024/06/18 14:22
Android开源库-用于显示标签的流式布局
Label
流式布局,封装用于显示标签
效果图:
使用方式:
1.添加布局
<com.brioal.labelview.LabelView android:id="@+id/main_label" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#213f" />
2.代码设置:
//设置点击事件 mLabelView.setListener(new OnLabelSelectedListener() { @Override public void selected(int position, String content) { Toast.makeText(MainActivity.this, content, Toast.LENGTH_SHORT).show(); } }); mList = new ArrayList<>(); //设置显示数据源 mList.add(new LabelEntity("对方的", "的钱我的我")); mList.add(new LabelEntity("打扫打扫", "的钱我的我")); mList.add(new LabelEntity("打扫打扫", "的钱我的我")); mList.add(new LabelEntity("打扫打扫打扫打扫", "的钱我的我")); mList.add(new LabelEntity("连骗带哄", "的钱我的我")); mList.add(new LabelEntity("连骗带哄", "的钱我的我")); //设置标签背景颜色 mLabelView.setLabelColor(Color.RED); mLabelView.setLabels(mList);
添加依赖的方法
Step 1. Add the JitPack repository to your build file
Add it in your root build.gradle at the end of repositories:
allprojects { repositories { ... maven { url "https://jitpack.io" } } }
Step 2. Add the dependency
最新版本在这
dependencies { compile 'com.github.Brioal:Label:1.0' }
完成
0 0
- Android开源库-用于显示标签的流式布局
- Android中常见的热门标签的流式布局的实现——云标签
- android流式布局--流式标签
- Android 流式布局-动态标签实现
- android 流式布局(热门标签)
- Android流式标签布局,自定义标签控件tagView
- <th>和<td>标签都是用于表格单元格显示的。
- 标签流式布局
- 标签流式布局
- 流式布局--标签
- 实现标签的流式布局
- 【Android Training - Performance】提高显示布局文件的性能[Lesson 2 - 使用include标签重用Layout]
- Android提高显示布局文件的性能,使用include标签重用layouts
- Android中常见的热门标签的流式布局的实现,类似购物的尺寸标签
- Android中常见的热门标签的流式布局的实现
- Android中常见的热门标签的流式布局的实现
- Android中常见的热门标签的流式布局的实现
- Android中常见的热门标签的流式布局的实现
- C# RichTextBox 滚动条 滚动到最后一行
- 单例模式之个人笔记(一)
- 装饰者模式笔记
- 《将博客搬至CSDN》
- Linux - C预习内容(六)
- Android开源库-用于显示标签的流式布局
- 公钥、私钥和数字签名理解
- 网页编码utf8 gb2312 gbk的区别
- HDU 5491 The Next(构造)
- mysql for windows 密码重置
- 数据结构基础——栈的C++实现
- 单片机--iic
- 玩转四旋翼无人机(姿态控制 in ArduPilot)
- php中中文字符串的截取和获取长度 mb_substr() mb_strlen()