【发布时间】:2021-07-05 21:26:06
【问题描述】:
我已启用并设置表单的工具栏。表单有一个带有标签集的 TextArea 组件,用作标题。导航到该屏幕时不显示标签。我认为它是重叠的。是这样吗?我错过了什么? 工具栏的全局设置设置为 false。
Form aFrm = new Form("aTitle", new BoxLayout(BoxLayout.Y_AXIS));
//Set up the toolbar using a static utility method.
GGUtil.setTheAppToolbar(aFrm);
//Create a TextArea to display the information from a Resource file.
TextArea aTxtArea = new TextArea(GGUtil.openResourceFileToString(null, "/atextfile.txt"));
//Signal virtual keyboard whether editing is allowed.
aTxtArea.setConstraint(TextArea.UNEDITABLE);
//Disable editing.
aTxtArea.setEditable(false);
//Grow in rows to display the content
aTxtArea.setGrowByContent(true);
//Create and set the text of the Label
Label txtAreaLabel = new Label("labelTitle");
//Set the Label for the TextArea
aTxtArea.setLabelForComponent(txtAreaLabel);
//Add the TextArea to the Form.
aFrm.add(aTxtArea);
...
遵循设置工具栏的静态实用方法的代码。
//Create a Toolbar obj for this Form.
Toolbar appToolbar = new Toolbar();
//Enable Toolbar for this Form only, setting the tile at the moment.
aForm.setToolbar(appToolbar);
//Set the title of the Toolbar.
appToolbar.setTitle("Toolbar Title");
//Create Container to hold "sandwich" menu options.
Form sandwichMenu = new Form("Settings", new BoxLayout(BoxLayout.Y_AXIS));
//Center the Toolbar
appToolbar.setTitleCentered(true);
//Create and add a "Close" button using another static utility method.
GGUtil.addCloseRightSettings(appToolbar, sandwichMenu, "Close");
//Add the "Settings" Form in the "sandwich" menu option.
appToolbar.addComponentToRightSideMenu(sandwichMenu);
...
【问题讨论】:
-
你能在问题中添加一个最小的示例代码,重现问题吗?可以加个截图吗?
-
@FrancescoGalgani 请立即查看。
-
我刚刚添加了一个答案
标签: codenameone