Android Custom TitleBar title bar conflict Issues

Source: Internet
Author: User

When you customize the title bar for Android, use the following method:


  1. Requestwindowfeature (Window.feature_custom_title);
  2. Setcontentview (R.layout.main);
  3. GetWindow (). Setfeatureint (Window.feature_custom_title,r.layout.mycustomtitle);
  4. }


Logcat Error "cannot combine custom titles with other title features"


Reason:

Because it was used in the manifest file.

Android:theme= "@style/apptheme" >

Workaround:

in Style.xml, add this phrase " <item name= "Android:windowactionbar" >false</item> "as follows:

<span style= "color: #333333;" ><resources> <!--Base application theme, dependent on API level.    This theme are replaced by Appbasetheme from Res/values-vxx/styles.xml on newer devices. --<style name= "Appbasetheme" parent= "Android:Theme.Light" > <!--Theme customizations av Ailable in newer API levels can go in res/values-vxx/styles.xml, while customizations related to BAC        Kward-compatibility can go here. -</style> <!--application theme.  --<style name= "Apptheme" parent= "Appbasetheme" > <!--all customizations that is not specific to a Particular api-level can go here. --</span><span style= "color: #ff0000;" ><item name= "Android:windowactionbar" >false</item> </span><span style= "color: #333333;" > </style></resources></span>



Android Custom TitleBar title bar conflict Issues

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.