In Android documentation describing “Configuring General Window Properties“, it is suggested that specifying properties via XML is preferable whenever possible to avoid seeing the title bar flash. As an example, instead of setting Window.FEATURE_NO_TITLE with requestWindowFeature, they set it to @android:style/Theme.NoTitleBar. Is there a similar way to set a custom title bar to be used in the XML?
In Android documentation describing Configuring General Window Properties , it is suggested that specifying
Share
The complete set of XML attributes available is documented in R.styleable. There does not appear to be any Window attribute for custom title, so
FEATURE_CUSTOM_TITLEcan only be set in code.According to this article, the best way to draw a title bar is to ignore
FEATURE_CUSTOM_TITLEand instead just draw the title bar as part of your main view. This would not only avoid the flashing, but also problems caused by padding.