Codename One Sidemenu 在永久模式下缺少内容

Codename One Sidemenu is Missing content when in permanent mode

我有一个带有 Toolbar 代码的 Codename One application that has a heavily customized side menu based on the old SideMenuBar. After noticing the blog post covering the ability to have a permanent sidemenu 我已将我的代码迁移到新的 Toolbar API.

代码非常相似并且运行良好,但是当我切换到永久侧边菜单模式时,一些元素丢失了。例如。 :

Command sep = new Command("");
sep.putClientProperty(new Label(" ", "Separator"));
toolbar.addCommandToSideMenu(sep);

完美显示分隔符,但在使用永久侧边菜单时不起作用。

那是适用于 SideMenuBar 的行为,但我们在迁移到 Toolbar API.

时没有保留该行为

您可以使用 addComponentToSidemenu