LWUIT Blackberry TextField 水平滚动
我遇到 LWUIT 文本字段滚动右侧问题。我正在使用它来捕获用户的电子邮件,当用户输入的电子邮件大于文本字段的宽度时,就会出现问题。然后文本会下降,用户在完成之前无法看到他写的内容。我尝试 setEnableInputScroll 使其向右滚动而不是向下滚动,但没有希望。
Container username = new Container(new BoxLayout(BoxLayout.X_AXIS));
Label emailLabel = new Label("E-mail");
emailLabel.setPreferredW(120);
emailLabel.getStyle().setAlignment(Label.RIGHT);
username.addComponent(emailLabel);
final TextField email = new TextField(userName);
email.setLabelForComponent(emailLabel);
email.setPreferredW(170);
email.setEnableInputScroll(true);
username.addComponent(email);
_form.addComponent(username);
I have a problem with LWUIT textfield scroll right issue. I am using it to capture an email from the user and the problem happened when the user enters an email greater than the width of the text field. The text then go down and the user can't see what he write until he finished. I tried setEnableInputScroll to make it scroll right instead of go down but without hope.
Container username = new Container(new BoxLayout(BoxLayout.X_AXIS));
Label emailLabel = new Label("E-mail");
emailLabel.setPreferredW(120);
emailLabel.getStyle().setAlignment(Label.RIGHT);
username.addComponent(emailLabel);
final TextField email = new TextField(userName);
email.setLabelForComponent(emailLabel);
email.setPreferredW(170);
email.setEnableInputScroll(true);
username.addComponent(email);
_form.addComponent(username);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
email.setSingleLineTextArea(true)
避免多行use
email.setSingleLineTextArea(true)
to avoid multiline