How to force a SpanLabel to break it's String

99封情书 提交于 2019-12-08 03:41:38

问题


I'm currently designing the sidemenu of a new app.

The idea is to have an accordion with four containers inside which uses a TableLayout with two columns. The containers are filled with components grouping an icon (ScaleImageLabel) atop of a SpanLabel, the group being lead by a Button.

In order to have an homogeneous sidemenu, I want that each component has the same width, so I've put all in a setSameWidth, BUT, here is my problem: Some components have a longer text than others, and if one of them get in the first column, it won't break it's text.

The issue here is that the second row is thinner than the first, and thus some texts are contracted too much...

Is it a way to force a SpanLabel tobreak it's text ? With this, I should be able to have a good sidemenu for my new app.

Thanks in advance !


回答1:


You can try \n if changing the text works for you.

Alternatively I would suggest using TextArea setting the UIID to Label and making it editable false. Then you can define the columns property for better control over line break.



来源:https://stackoverflow.com/questions/46283696/how-to-force-a-spanlabel-to-break-its-string

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!