android - Custom titlebar - system titlebar being shown for a brief moment? -
i've got custom layout want use titlebar of android app. technique found (linked @ bottom) works, system titlebar displayed before oncreate() called. looks pretty jarring, moment system titlebar shown, custom titlebar shown:
// styles.xml <resources> <style name="mytheme"> <item name="android:windowtitlesize">40dip</item> </style> </resources> // 1 of activities, mytheme applied in manifest. protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); requestwindowfeature(window.feature_custom_title); setcontentview(r.layout.my_activity); getwindow().setfeatureint(window.feature_custom_title, r.layout.my_custom_header); }
i hide system titlebar , display own in-line perhaps each , every layout, but, that's not friendly.
thanks
http://www.londatiga.net/it/how-to-create-custom-window-title-in-android/
i think it's framework limitation. had same problem in of applications , ultimate solution me tell framework didn't want title bar @ , create own in layouts. include directive made bearable me, e.g.:
<include layout="@layout/title" />
when used requestwindowfeature(window.feature_no_title) in activities, have same issue, i'd see system title bar briefly while activity being build when first loaded.
when switched using theme tell framework didn't want title, problem went away , see own title directly on first load. styling easy that:
<style name="fliqtheme" parent="@android:theme.black"> <item name="android:windownotitle">true</item> </style>
i know doesn't apply issue custom title, ptc mentioned, if move custom title style/theme definitions (which overriding system title styles in theme), think you'll on right track.
Comments
Post a Comment