1
votes

I'm coding an app via Codename One. Since the screen of an iPad or other tablet is bigger than a phone's display and that would leave me with a bunch of open space, I was wondering if there is something in Codename One to have an image pop-up on a tablet but that it is not visible on a phone's display.

So is there something like that? How can I use it?

Thank you in advance!

  • Nick van Kesteren
1

1 Answers

0
votes

You can use Display.isTablet() to adapt the UI for a tablet. Normally you don't do this at the image level but rather at a Container level.

E.g. I could do something like this:

Form myForm = new Form("My Title", new BorderLayout());

// add the stuff that's always here...


if(Display.getInstance().isTablet()) {
   myForm.add(BorderLayout.EAST, createAdditionalTabletUI());
}

You can also enable other things such as permanent side menu to make the UI use the tablet aspects more intelligently.