在我的Codenameone应用程序中,我已经建立了一个侧面菜单,但是我有2个外观问题。
对于参考,我的菜单沿用this tutorial的设计,下面是一个非常简单的示例:
public void start() {
if (current != null) {
current.show();
return;
}
Form hi = new Form("Hi World", BoxLayout.y());
hi.add(new Label("Hi World"));
Toolbar t = new Toolbar();
hi.setToolbar(t);
t.setTitle("Title");
Label logoLabel = new Label("");
logoLabel.setTextPosition(Label.BOTTOM);
logoLabel.setText("label text here");
t.addComponentToSideMenu(logoLabel);
hi.show();
}
谢谢
关闭点似乎在此处被硬编码到屏幕的四分之一:https://github.com/codenameone/CodenameOne/blob/master/CodenameOne/src/com/codename1/ui/Toolbar.java#L1380
代码中可能有其他要实现此逻辑的点。可能可以更改它,以使该逻辑可以通过主题常量进行配置。但是现在这是硬编码的。