我有一个文本区域,通常可以工作但是十分之一时间,它会发生故障。会发生什么是键盘与文本区域重叠,然后在上面的其他组件中看到写入的文本,然后应用程序挂起。如果单击后面的btn,它似乎再次起作用,但问题一再出现
观看视频here
码
public TestDrive(Resources res) {
super(new BorderLayout());
getToolbar().setTitle("Test Drive");
nameLabel = new Label("Name*: ");
nameLabel.setUIID("small");
nameData = new TextField();
mailLabel = new Label("Email*: ");
mailLabel.setUIID("small");
mailData = new TextField();
mobileLabel = new Label("Mobile No*: ");
mobileLabel.setUIID("small");
mobileData = new TextField();
addressLabel = new Label("Address*: ");
addressLabel.setUIID("small");
addressData = new TextField();
vehicleLabel = new TextArea("Current Vehicle: ");
vehicleData = new TextField();
interestedModelLabel = new TextArea("Model Intestested*: ");
interestedModelData = new Picker();
interestedModelData.setType(Display.PICKER_TYPE_STRINGS);
interestedModelData.setSelectedString("Select the model");
TextArea preferredDateLabel = new TextArea("Preferred Date: ");
Picker preferredDateData = new Picker();
preferredDateData.setType(Display.PICKER_TYPE_DATE);
TextArea preferredTimeLabel = new TextArea("Preferred Time: ");
Picker preferredTimeData = new Picker();
preferredTimeData.setType(Display.PICKER_TYPE_TIME);
TextArea preferredLocationLabel = new TextArea("Preferred Location: ");
Picker preferredLocationData = new Picker();
preferredLocationData.setType(Display.PICKER_TYPE_STRINGS);
preferredLocationData.setTickerEnabled(false);
preferredLocationData.setSelectedString("Select the dealer location");
Label commentLabel = new Label("Comment*: ");
TextArea commentData = new TextArea(); //problem occurs here
commentData.setRows(4);
commentData.setUIID("TextField");
commentData.setScrollVisible(false);
Button submitButton = new Button(" Submit ");
TableLayout tl = new TableLayout(5, 2);
Container testDriveContainer = new Container(tl);
testDriveContainer.add(tl.createConstraint().widthPercentage(35), nameLabel).add(tl.createConstraint().widthPercentage(65), nameData)
.add(tl.createConstraint().widthPercentage(35), mailLabel).add(tl.createConstraint().widthPercentage(65), mailData)
.add(tl.createConstraint().widthPercentage(35), mobileLabel).add(tl.createConstraint().widthPercentage(65), mobileData)
.add(tl.createConstraint().widthPercentage(35), addressLabel).add(tl.createConstraint().widthPercentage(65), addressData)
.add(tl.createConstraint().widthPercentage(35), FlowLayout.encloseCenterMiddle(vehicleLabel)).add(tl.createConstraint().widthPercentage(65), vehicleData)
.add(tl.createConstraint().widthPercentage(35), FlowLayout.encloseCenterMiddle(interestedModelLabel)).add(tl.createConstraint().widthPercentage(65), interestedModelData)
.add(tl.createConstraint().widthPercentage(35), FlowLayout.encloseCenterMiddle(preferredDateLabel)).add(tl.createConstraint().widthPercentage(65), preferredDateData)
.add(tl.createConstraint().widthPercentage(35), FlowLayout.encloseCenterMiddle(preferredTimeLabel)).add(tl.createConstraint().widthPercentage(65), preferredTimeData)
.add(tl.createConstraint().widthPercentage(35), FlowLayout.encloseCenterMiddle(preferredLocationLabel)).add(tl.createConstraint().widthPercentage(65), preferredLocationData)
.add(tl.createConstraint().widthPercentage(35), commentLabel).add(tl.createConstraint().widthPercentage(65), commentData);
Container mainContainer = BoxLayout.encloseY(testDriveContainer, FlowLayout.encloseCenter(submitButton));
mainContainer.setScrollableY(true);
add(BorderLayout.CENTER, mainContainer);
revalidate();
}
答案 0 :(得分:2)
感谢您报告此事。此问题已在Git https://github.com/codenameone/CodenameOne/commit/7ba4c547b4464fa529e2378b4dd4c465cd290963中修复。该修复程序将包含在星期五的下一次服务器更新中。