我有一个addEvent表单 . 这里有一个没有 . 要由用户填写的字段 . 有文本字段,拣货员,textArea等 . 当我专注于表格顶部的文本字段时,键盘效果很好 . 我注意到键盘上的完成按钮位于键盘的底部 . 但是,只要表单底部的textfield或textArea聚焦,就会显示键盘顶部带有完成按钮的键盘 . 单击完成按钮后,表单顶部有白色空白区域,我认为高度键盘占用之前 .

更新1:descriptionTextArea给出了问题 .

f.setLayout(new BoxLayout(BoxLayout.Y_AXIS));

Label eventImage = new Label();
TextField eventNameTextField = new TextField();

Button uploadImg = new Button(theme.getImage("uploadImg.png"));
//uploadImg actionListener code is skipped here
Container eventNameContainer = new Container(new BorderLayout());
Label maxSizeLabel = new Label("Max size 1mb");

Container wrapUploadIconAndMsg = new Container(new BorderLayout());
wrapUploadIconAndMsg.add(BorderLayout.WEST, uploadImg);
wrapUploadIconAndMsg.add(BorderLayout.CENTER, maxSizeLabel);
eventNameContainer.add(BorderLayout.NORTH, (BoxLayout.encloseY(eventImage, wrapUploadIconAndMsg)));
eventNameContainer.add(BorderLayout.CENTER, (eventNameTextField));

Picker startDate = new Picker();
Picker startTime = new Picker();

Container startContainer = GridLayout.encloseIn(2, startDate, startTime);
Label timeIcon = new Label(iconEvent);
Container wrapStartContainer = BoxLayout.encloseX(FlowLayout.encloseCenter(timeIcon), (startContainer));

Label timeIconInvisible = new Label(iconEvent);
timeIconInvisible.setVisible(false);

Picker endDate = new Picker();
Picker endTime = new Picker();

Container endContainer = GridLayout.encloseIn(2, endDate, endTime);
Container wrapEndContainer = BoxLayout.encloseX((timeIconInvisible), FlowLayout.encloseCenterBottom(endContainer));

Label descriptionIcon = new Label();
descriptionIcon.setIcon(iconDescription);

TextArea descriptionTextArea = new TextArea();
descriptionTextArea.setRows(4);
descriptionTextArea.setMaxSize(240);
descriptionTextArea.setVerticalAlignment(Label.TOP);

Container descriptionContainer = new Container(new BorderLayout());
descriptionContainer.add(BorderLayout.WEST, descriptionIcon);
descriptionContainer.add(BorderLayout.CENTER, descriptionTextArea);
Container wrapEventContainer = BoxLayout.encloseY(eventNameContainer, wrapStartContainer, wrapEndContainer, descriptionContainer);

f.add(wrapEventContainer);
f.revalidate();

1)初始形式:

enter image description here

2)键盘底部带有完成按钮的键盘(此处工作正常) - 使用表格顶部的文本字段 .

enter image description here

3)键盘顶部带有完成按钮的键盘(触摸完成后出现问题)

enter image description here

4)按下完成后的问题 . (看到空白区域)我认为它的高度等于键盘的高度

enter image description here