2
votes

I'm trying the charts class, I'm trying to display a return button but it's not displaying. Here's the full code. Please feel free to edit it in case you can help.

I also thought about an easier solution, a toolbar but where can I put it because I tried and it didn't display the button?!

getToolbar().addMaterialCommandToLeftBar("", FontImage.MATERIAL_ARROW_BACK, e-> previous.showBack());

OUTPUT: enter image description here

Here's the code: CODE

2
@chen is correct but I think the back command is there, I just think it's blue by default on iOS and you can't see it on your theme. Style the BackCommand UIID and TitleCommand UIID to have a color with enough contrast. I discuss styling and finding out UIIDs with component inspector here: youtube.com/watch?v=JVYOWGnr8iU - Shai Almog

2 Answers

2
votes

Try this:

getToolbar().setBackCommand("", e-> previous.showBack());

0
votes

Maybe this works

toolbar=new Toolbar();
toolbar.setTitle(titleString);
form.setToolbar(toolbar);
toolbar.setEnabled(true);
toolbar.addMaterialCommandToLeftBar("", FontImage.MATERIAL_ARROW_BACK, e-> previous.showBack());
toolbar.showToolbar();