Native Back on Codenameone after using Toolbar class

老子叫甜甜 提交于 2019-12-08 13:15:27
Diamond

What do you mean disappear? This is how i use Toolbar API:

Toolbar t = new Toolbar();
myForm.setToolbar(t);
t.setTitle("My title");
Command back = new Command("back") {

   @Override
   public void actionPerformed(ActionEvent evt) {
       myForm.showBack();
   }
};
myForm.setBackCommand(back);
t.addCommandToLeftBar(back);

This will take care of both Android hardware back button and placing a back command at the top.

Note that you also have to style BackCommand UIID or allow it to use default, Just make sure the default color doesn't match the TitleArea color.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!