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

怎样使同一个标签内的文字 显示不同的颜色 #38

Open
sugela opened this issue Dec 2, 2019 · 1 comment
Open

怎样使同一个标签内的文字 显示不同的颜色 #38

sugela opened this issue Dec 2, 2019 · 1 comment

Comments

@sugela
Copy link

sugela commented Dec 2, 2019

No description provided.

@donkingliang
Copy link
Owner

你的意思是给便签设置SpannableString显示富文本吗?
labelsView.setLabels(testList, new LabelsView.LabelTextProvider() {
@OverRide
public CharSequence getLabelText(TextView label, int position, TestBean data) {
// 可以在这里返回SpannableString对象,这个对象会设置到标签的文本上。
return data.getName();
}
});
如果你是想让同一个标签列表里的每个标签显示不同的颜色,也可以用上面的方法在getLabelText里给label设置setTextColor()。

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

2 participants