Android custom title and android custom title

Source: Internet
Author: User

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 ().

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.