Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

点击改变背景色怎么实现 #8

Open
douya40 opened this issue Oct 9, 2016 · 2 comments
Open

点击改变背景色怎么实现 #8

douya40 opened this issue Oct 9, 2016 · 2 comments

Comments

@douya40
Copy link

douya40 commented Oct 9, 2016

点击改变背景色怎么实现

@WangningGITHUB
Copy link

怎样改变背景颜色呀

@longalei
Copy link

longalei commented Sep 5, 2017

看到有人不会改变这标签的背景色,或许我写的下面的代码能够帮助到你~
TagCloudLayout selectTags;
selectTags.setItemClickListener(new TagCloudLayout.TagItemClickListener() {
@OverRide
public void itemClick(int position) {
//判断集合中是否有选中的标签,有则移除,没有则添加。并改变字体的颜色
TextView tagsText = (TextView) selectTags.getChildAt(position);
if (tagsText.getCurrentTextColor() == getResources().getColor(R.color.red_FF3688)) {
for (int i = 0; i < mSubmitTagsList.size(); i++) {
if (mSubmitTagsList.get(i).contains(tagsList.get(position).getId() + ",")) {
mSubmitTagsList.remove(i);
}
}
tagsText.setTextColor(getResources().getColor(R.color.black_606060));
} else {
tagsText.setTextColor(getResources().getColor(R.color.red_FF3688));
mSubmitTagsList.add(tagsList.get(position).getId() + ",");
}
}
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants