参考了这篇博文
http://blog.youkuaiyun.com/wangjinyu501/article/details/38089061
实现效果:
1.标签排列,右对齐。
2.点击第一个标签添加标签。
3.点击非第一个标签,可以将标签删除。
效果图:
因为是在别人的基础上修改的,我就只把我修改的部分代码贴出来
第一点
为了实现从右边开始排列,重写了FlowLayout的onLayout方法:
protected void onLayout(boolean changed, int l, int t, int r, int b) {
final int count = getChildCount();
for (int i = 0; i < count; i++) {
View child = getChildAt(i);
int c = getWidth();
LayoutParams lp = (LayoutParams) child.getLayoutParams();
int cl = lp.x;//左边初始坐标
int