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

如何给标签设置不同的背景色 #39

Open
sangsais opened this issue Dec 30, 2019 · 1 comment
Open

如何给标签设置不同的背景色 #39

sangsais opened this issue Dec 30, 2019 · 1 comment

Comments

@sangsais
Copy link

比如有六个标签,每个标签都配置了不同的背景色

@donkingliang
Copy link
Owner

labelsView.setLabels(testList, new LabelsView.LabelTextProvider() {
@OverRide
public CharSequence getLabelText(TextView label, int position, TestBean data) {
// 在这里可以给你的标签项单独设置属性。比如标签背景,文字颜色等:
label.setBackgroundResource(resId);
return data.getName();
}
});

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