Question

is there a possibility to define somehow title's height?

The main problem is a separator that is located under the actual title. So, possibly there is possibility to define somehow the separator's height.

API 4.5

Thanks

Was it helpful?

Solution

I have experienced this myself and the only way I know of to get around it is to override the (undocumented) method in MainScreen:

protected void applyTheme() {
    // leave this empty
}

This prevents the theme from setting colors and also seems to get rid of the separator between the title and main content.

OTHER TIPS

You'll want to use the setExtent method.

To simply get title height try this:

class Scr extends MainScreen {
    public Scr() {
        setTitle("Hello!");
        Manager contentManager = getMainManager();
        Manager screenManager = contentManager.getManager();
        Field titleField = screenManager.getField(0);
        int height = titleField.getPreferredHeight();
        add(new LabelField(String.valueOf(height)));
    }
}

And to define title yourself, try to put custom field into setTitle

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top