如何强制SpanLabel破坏其字符串 [英] How to force a SpanLabel to break it's String

查看:36
本文介绍了如何强制SpanLabel破坏其字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在设计一个新应用程序的菜单。

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

我们的想法是让一个带有四个容器的手风琴使用一个带有两列的TableLayout。容器中填充有将SpanLabel顶部的图标(ScaleImageLabel)分组的组件,该组由Button领导。

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.

为了拥有统一的侧面菜单,我要每个组件具有相同的宽度,所以我将所有组件都放在setSameWidth中,但这是我的问题:某些组件的文本比其他组件长,并且如果其中一个出现在第一列中,它将不会中断这是文字。

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...

是否可以强制SpanLabel破坏其文本?有了这个,我应该能够为我的新应用程序提供一个不错的辅助菜单。

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.

预先感谢!

推荐答案

如果更改文本对您有用,则可以尝试 \n

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

或者,我建议使用 TextArea 将UIID设置为 Label 并使其可编辑错误。然后,您可以定义属性,以更好地控制换行符。

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.

这篇关于如何强制SpanLabel破坏其字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆