문제

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

도움이 되었습니까?

해결책

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.

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top