多线实验室

And*_*osa 3 blackberry java-me blackberry-jde

我必须显示一个字符串,该字符串可以大小不足以在所有设备中不能放入一行,我希望labelfield控件能够在原始字符之后自动显示"新行"中的剩余文本,我的意思是...自动的carret返回如果字符串不能显示在一行中,我尝试过的所有移动操作系统都会这样做,但我无法使BB操作系统工作,只要它喜欢就截断我的字符串,这非常烦人.

谢谢

Ray*_*hey 8

一种方法是将包含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);
Run Code Online (Sandbox Code Playgroud)