【发布时间】:2016-09-25 07:26:06
【问题描述】:
我注意到使用的是 Codename one 的最新版本。
当我的侧边菜单(汉堡菜单)位于右侧时,阴影图像会翻转。
在模拟器和安卓和iOS上似乎是这样。
我似乎记得我最近不得不解决这个问题,但是这个解决方法似乎不再起作用了。
我尝试使用主题常量替换 imahe,并通过将 sideMenuShadowBool 设置为 false 来关闭它。但这些似乎都不再做任何事情了。
截图:
代码片段(在每个表单的 beforeShow 中调用):
private void setupTitleBar(Form f, FormController fc) {
if (handler == null) {
handler = new MenuHandler();
sm.addCommandListener(handler);
}
for (int c = 0; c < f.getCommandCount(); c++) {
f.removeCommand(f.getCommand(c));
}
Toolbar tb = new Toolbar();
f.setToolbar(tb);
fc.setupTitlebar(tb);
String formName = f.getName();
if (!"Main".equals(formName)
&& !"Signup".equals(formName)
&& !"MyCards".equals(formName)
&& !("Orders".equals(formName) && !ModuleManager.isModuleEnabled(ModuleManager.LOYALTY))) {
Command back = new Command("", sm.getImage("back.png"), BACK);
back.putClientProperty("TitleCommand", true);
f.setBackCommand(back);
tb.addCommandToLeftBar(back);
}
if (!"Main".equals(formName)
&& !"Signup".equals(formName)) {
addSideCommand("Logout", "LogoutSideOption", LOGOUT, e->logoutUser(), tb);
addSideCommand("View T&Cs", "TnCSideOption", TANDC, e->showTandCs(), tb);
addSideCommand("Reset Tutorials", "TnCSideOption", CLEAR_TUTORIAL, e->clearTutorial(), tb);
}
}
private void addSideCommand(String name, String udid, int commandID, ActionListener event, Toolbar tb) {
Command command = new Command(name, null, commandID);
command.putClientProperty(SideMenuBar.COMMAND_PLACEMENT_KEY, SideMenuBar.COMMAND_PLACEMENT_VALUE_RIGHT);
Button comandLabel = new Button(name);
comandLabel.setUIID(udid);
command.putClientProperty(SideMenuBar.COMMAND_SIDE_COMPONENT, comandLabel);
tb.addCommandToSideMenu(command);
comandLabel.addActionListener(event);
}
【问题讨论】:
-
你能添加截图和你的代码sn-p吗?
-
我已经编辑了帖子。谢谢陈
标签: android ios codenameone hamburger-menu