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

如何设置多个标签的等宽? #54

Open
Fomovet opened this issue Oct 19, 2021 · 3 comments
Open

如何设置多个标签的等宽? #54

Fomovet opened this issue Oct 19, 2021 · 3 comments

Comments

@Fomovet
Copy link

Fomovet commented Oct 19, 2021

我尝试按照自定义属性设置app:labelTextWidth="match_parent"但是这样只能使第一个标签宽度铺满:

微信截图_20211019121934

我需要实现以下效果应该怎么做呢?:

微信截图_20211019121625

@donkingliang
Copy link
Owner

match_parent会让label铺满父布局,所以这样设置,每个label都会铺满宽。如果你想label固定宽度,应该设置固定值。如果你想label宽度是父布局的4分之一,就要自己计算宽度

@exinglang
Copy link

match_parent会让label铺满父布局,所以这样设置,每个label都会铺满宽。如果你想label固定宽度,应该设置固定值。如果你想label宽度是父布局的4分之一,就要自己计算宽度

你好,但是也没有setLabelTextWidth啊,该如何设置?

@donkingliang
Copy link
Owner

match_parent会让label铺满父布局,所以这样设置,每个label都会铺满宽。如果你想label固定宽度,应该设置固定值。如果你想label宽度是父布局的4分之一,就要自己计算宽度

你好,但是也没有setLabelTextWidth啊,该如何设置?
可以在xml设置labelTextWidth,也可以用下面的方法代码设置
1644458056(1)

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