Android 标签群组 TagGroup
- 授权协议: MPL
- 开发语言: Java
- 操作系统: Android
- 软件首页: http://git.oschina.net/xiao-lifan/TagGroup
- 软件文档: http://git.oschina.net/xiao-lifan/TagGroup
软件介绍
TagGroup 是标签群组,支持文字和程序内部图片。
1、TagGroup属性介绍
<com.xiaofan.taggroup.TagGroup android:id="@+id/tagGroup" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#f08070" app:tagBackgroundColor="#ffffff" app:tagCornerRadius="6dp" app:tagHorizontalPadding="8dp" app:tagHorizontalSpace="8dp" app:tagStrokeColor="#000000" app:tagTextColor="#000000" app:tagTextSize="16sp" app:tagVerticalPadding="4dp" app:tagVerticalSpace="8dp" />
tagBackgroundColor:标签背景色;
tagCornerRadius:标签圆角半径;
tagHorizontalPadding:标签水平方向内边距;
tagHorizontalSpace:标签之间的水平间距;
tagStrokeColor:标签的描边颜色;
tagTextColor:标签文字颜色;
tagTextSize:标签文字大小;
tagVerticalPadding:标签竖直方向内边距;
tagVerticalSpace:标签之间的竖直边距。
2、添加标签
ArrayList<Tag> tags = new ArrayList<>();
for (int i = 0; i < 7; i++) {
Tag tag = new Tag();
tag.setType(Tag.TYPE_TEXT);
tag.setTagText("tag" + i);
tags.add(tag);
}
Tag tag = new Tag();
tag.setType(Tag.TYPE_ICON);
tag.setIconID(R.drawable.icon_apple);
tags.add(tag);
tag = new Tag();
tag.setType(Tag.TYPE_ICON);
tag.setIconID(R.drawable.icon_banana);
tags.add(tag);
tag = new Tag();
tag.setType(Tag.TYPE_ICON);
tag.setIconID(R.drawable.icon_pear);
tags.add(tag);
tag = new Tag();
tag.setType(Tag.TYPE_ICON);
tag.setIconID(R.drawable.icon_more);
tags.add(tag);
tagGroup.setTags(tags);3、绑定标签点击事件监听器
需要实现TagGroup的OnTagClickListener接口,然后调用setOnTagClickListener设置监听器即可。
Python Cookbook
Alex Martelli、Anna Ravenscroft、David Ascher / 高铁军 / 人民邮电出版社 / 2010-5-1 / 99.00元
本书介绍了Python应用在各个领域中的一些使用技巧和方法,从最基本的字符、文件序列、字典和排序,到进阶的面向对象编程、数据库和数据持久化、 XML处理和Web编程,再到比较高级和抽象的描述符、装饰器、元类、迭代器和生成器,均有涉及。书中还介绍了一些第三方包和库的使用,包括 Twisted、GIL、PyWin32等。本书覆盖了Python应用中的很多常见问题,并提出了通用的解决方案。书中的代码和方......一起来看看 《Python Cookbook》 这本书的介绍吧!
