带有不可编辑文本的可滚动字段
在我的应用程序中,我需要一个可滚动字段,其中包含具有自定义大小的不可编辑文本。我正在尝试这样做:
final int sx2 = Display.getWidth()-Display.getWidth()*2/51-kButtonWidgh;
final int sy2 = Display.getHeight()*7/12;
VerticalFieldManager vfm3 = new VerticalFieldManager()
{
public void sublayout( int maxWidth, int maxHeight )
{
super.sublayout(sx2, sy2);
}
};
text = new TextField((Field.FOCUSABLE & Field.READONLY & Field.STATUS_MOVE_FOCUS_HORIZONTALLY)){
public void layout( int maxWidth, int maxHeight ) {
super.layout(sx2, sy2); //my custom frame
}
};
vfm3.add(text);
vfm2.add(vfm3);
但它是可编辑的,并且不可滚动。文本从起始字段开始打印,并在远离框架的地方结束。光标超出了场框,并且没有滚动。我该怎么做?
In my app I need a scrollable field with non-editable text with custom size. I'm trying to do this like below:
final int sx2 = Display.getWidth()-Display.getWidth()*2/51-kButtonWidgh;
final int sy2 = Display.getHeight()*7/12;
VerticalFieldManager vfm3 = new VerticalFieldManager()
{
public void sublayout( int maxWidth, int maxHeight )
{
super.sublayout(sx2, sy2);
}
};
text = new TextField((Field.FOCUSABLE & Field.READONLY & Field.STATUS_MOVE_FOCUS_HORIZONTALLY)){
public void layout( int maxWidth, int maxHeight ) {
super.layout(sx2, sy2); //my custom frame
}
};
vfm3.add(text);
vfm2.add(vfm3);
But it editable, and not scrollable. Text prints from beginning field and ends far away from it's frame. there is cursor, which goes out of field frame, and there is no scrolling. How should I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个:
try this: