Android custom title and android custom title
RequestWindowFeature (Window. FEATURE_CUSTOM_TITLE); setContentView (Res. layout (this, "layout_select"); // the layout of the software activity getWindow (). setFeatureInt (Window. FEATURE_CUSTOM_TITLE, Res. layout (this, "layout_title_bar"); // titlebar is the layout of the title bar getWindow (). setFlags (WindowManager. layoutParams. FLAG_FULLSCREEN, WindowManager. layoutParams. FLAG_FULLSCREEN );
<?xml version="1.0" encoding="utf-8"?><resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="PayHubWindowTitleBackground"> <item name="android:background">@color/title_bg</item> </style> <style name="TitleBar_Pay_Hub" parent="android:Theme"> <item name="android:windowTitleBackgroundStyle">@style/PayHubWindowTitleBackground</item> </style> <style name="TitleTheme" parent="android:Theme"> <!-- Window attributes --> <item name="android:windowTitleBackgroundStyle">@style/PayHubWindowTitleBackground</item> <item name="android:windowTitleSize">@dimen/title_height</item> </style></resources>
<activity android:name="com.lenovo.newui.SelectActivity" android:configChanges="keyboardHidden|orientation|navigation" android:screenOrientation="portrait" android:theme="@style/TitleTheme" > </activity>
An error occurred while customizing the title bar of android.
As mentioned above, the operation is successful. You can check it.
Www.cnblogs.com/...7.html
If you have reported any errors, paste them to us !!
Why does the android custom title style report such an error?
GetWindow (). setFeatureInt (Window. FEATURE_CUSTOM_TITLE, R. layout. title_buy) must be called before setContentView ().