多行标签字段

发布于 2024-11-16 10:55:42 字数 200 浏览 4 评论 0原文

我必须显示一个字符串,该字符串可以足够大,也可以不够大,以至于无法容纳在所有设备中的一行中,我希望 labelfield 控件自动在原始文本之后的“新行”中显示剩余文本,我的意思是... auomatic carret如果字符串不能在一行中显示,则返回,我尝试过的所有移动操作系统都这样做,但我无法使 BB 操作系统工作,它只是在需要时截断我的字符串,这非常烦人。

谢谢

I must show a string that can or not be large enough to not fit in one line in all devices, I want labelfield control to automatically show remaining text in a "new line" after the original one, I mean like... auomatic carret return if the string cannot be showed in a single line, all mobile OS I have tried do this, but I cannot make BB OS to work, it just truncates my string whenever it likes and it's very annoying.

Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蓝颜夕 2024-11-23 10:55:42

一种方法是将包含 LabelField 的 Horizo​​ntalFieldManager 放入 VerticalFieldManager 中。

例如

LabelField labelField = new LabelField("This is a very long sentance that I have written to show that the text will wrap around when it gets to the edge of the field.");
VerticalFieldManager vfm = new VerticalFieldManager();
HorizontalFieldManager hfm = new HorizontalFieldManager();
hfm.add(labelField);
vfm.add(hfm);

add(vfm);

One way to do this is put your HorizontalFieldManager that contains the LabelField inside a VerticalFieldManager.

E.g.

LabelField labelField = new LabelField("This is a very long sentance that I have written to show that the text will wrap around when it gets to the edge of the field.");
VerticalFieldManager vfm = new VerticalFieldManager();
HorizontalFieldManager hfm = new HorizontalFieldManager();
hfm.add(labelField);
vfm.add(hfm);

add(vfm);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文