问题
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