Android图片添加标签:Android-PictureTagView
2015-11-02 14:32
411 查看
Android图片添加标签:Android-PictureTagView
在一些社交类、美图类的Android APP中,会给用户提供一项功能就是给图片添加一些标签,这种功能需求可以使用一个在githubs上的第三方的开源库Android-PictureTagView。
Android-PictureTagView在github上的项目主页:https://github.com/saiwu-bigkoo/Android-PictureTagView
截止目前,Android-PictureTagView的版本中,比较关键的是PictureTagLayout。此类将加载到PictureTagLayout布局中的ImageView添加一些标签,当点击PictureTagLayout布局中的ImageView时,就自动添加进去一些标签,这些标签支持拖曳移动,但似乎目前不支持添加后删除,如果欲删除这些标签,则需要开发者自己再做二次定制开发,据我初步对源代码的阅读和分析,比如,可以在PictureTagLayout中增加长按事件,长按后弹出对话框然后删除等等动作。
(1) 使用Android-PictureTagView。直接在布局中像普通的线性布局或者相对布局一样使用PictureTagLayout(PictureTagLayout继承自RelativeLayout)。
(2) 在PictureTagLayout中写入一个ImageView。此ImageView将被用户的点击事件触发添加标签动作。
比如,写一个布局文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:orientation="vertical" >
<com.picturetagview.PictureTagLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/ic_launcher" />
</LinearLayout>
运行结果如图:
附录一些相关供进一步开发的文章:
《Android View转换成图片保存》链接地址:http://blog.csdn.net/zhangphil/article/details/44217539
Android图片添加标签:Android-PictureTagView
在一些社交类、美图类的Android APP中,会给用户提供一项功能就是给图片添加一些标签,这种功能需求可以使用一个在githubs上的第三方的开源库Android-PictureTagView。
Android-PictureTagView在github上的项目主页:https://github.com/saiwu-bigkoo/Android-PictureTagView
截止目前,Android-PictureTagView的版本中,比较关键的是PictureTagLayout。此类将加载到PictureTagLayout布局中的ImageView添加一些标签,当点击PictureTagLayout布局中的ImageView时,就自动添加进去一些标签,这些标签支持拖曳移动,但似乎目前不支持添加后删除,如果欲删除这些标签,则需要开发者自己再做二次定制开发,据我初步对源代码的阅读和分析,比如,可以在PictureTagLayout中增加长按事件,长按后弹出对话框然后删除等等动作。
(1) 使用Android-PictureTagView。直接在布局中像普通的线性布局或者相对布局一样使用PictureTagLayout(PictureTagLayout继承自RelativeLayout)。
(2) 在PictureTagLayout中写入一个ImageView。此ImageView将被用户的点击事件触发添加标签动作。
比如,写一个布局文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:orientation="vertical" >
<com.picturetagview.PictureTagLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/ic_launcher" />
</LinearLayout>
运行结果如图:
附录一些相关供进一步开发的文章:
《Android View转换成图片保存》链接地址:http://blog.csdn.net/zhangphil/article/details/44217539
相关文章推荐
- Android中使用Handler造成内存泄露的原因和解决方法
- Android Rect和RectF的区别
- android viewpager轮播图无限循环
- Android 笔记-Fragment 与 Activity之间传递数据
- Android Matrix类以及ColorMatri
- (转)【Android】Paint的效果研究
- Android开发之AIDL的使用一--跨应用启动Service
- Android studio自动安装releaseAPK
- android listview左划删除与点击事件及item样式扩展
- android编程之下拉刷新实现方法分析
- android是用一个服务好还是开一个线程好
- Android~Handler机制自我理解
- Android EditText的设置
- 2015-11-02-Android Apk签名总结
- Android JS 与本地代码交互---JSBridge使用注意事项
- 学习网址记录
- 安卓开发中EditText的焦点改变处理(获取焦点和失去焦点交互变化)
- Android onTouchEvent和setOnTouchListener中onTouch的区别
- Android获取跳转URI及携带的参数
- Android资源文件R.string.hello_world与getResources().getString(id)