3
votes

I have a splash screen and login form that need to be displayed full-screen without any tool/menu/title bars.The form is displaying with a bar near the top of the screen that I believe to be the TitleArea.

The scenario is identical to that described on https://groups.google.com/forum/#!topic/codenameone-discussions/2sgVfNYU9rk

In that discussion, Shai recommends a solution of setting the TitleArea UIID transparency to 0. As I only want the title area to be invisible on these specific forms, I created a new UIID TitleAreaTransparent with a background transparency of 0 and instantiated the SplashScreen form as follows:

    SplashScreen f = new SplashScreen(theme);
    Container tArea = f.getTitleArea();
    tArea.setUIID("TitleAreaTransparent");
    f.show();

This does make the bar disappear, however I have two concerns.

1) Even though the TitleArea is transparent, it still takes up some real estate on the form. In this particular case it doesn't matter but there will be other situations where I may need to use the entire screen and I would like to simply eliminate that component entirely. What is the proper way to do this?

2) The javadoc says that getTitleArea() is deprecated but that There are some alternatives such as command behavior (thru Display or the theme constants) I did some digging and was unable to find anything that sheds light on how to do what I need to do. What is the proper way to change the UIID of the TitleArea component?

1

1 Answers

1
votes

In this approach getTitleArea() is still essential. If you don't set a title the title area should be 0 but the status bar will still take up space as it pushes the UI down so it won't rended under the iOS status bar area.

You can disable that by styling the StatusBar UIID globally (not recommended) or thru something like this in your Form subclass:

@Override
protected Component createStatusBar() {
    Component c = super.createStatusBar();
    c.getUnselectedStyle().setPadding(0, 0, 0, 0);
    return c;
}