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

请问可以设置一个标签最大显示字数吗 #53

Open
dd9000901 opened this issue Jun 1, 2021 · 1 comment
Open

请问可以设置一个标签最大显示字数吗 #53

dd9000901 opened this issue Jun 1, 2021 · 1 comment

Comments

@dd9000901
Copy link

请问可以设置一个标签最大显示字数吗,最后用....显示

@donkingliang
Copy link
Owner

如果没有方法直接修改标签属性,你可以通过下面这种方式修改,每个标签都是一个TextView,TextView的属性都可以设置

labelsView.setLabels(testList, new LabelsView.LabelTextProvider<TestBean>() {
    @Override
    public CharSequence getLabelText(TextView label, int position, TestBean data) {
    
    	// label就是标签项,在这里可以对标签项单独设置一些属性,比如文本样式等。
    
    	//根据data和position返回label需要显示的数据。
        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