Android Theme Theme Inheritance (SDK under Themes and V7 package under themes)

Source: Internet
Author: User

Theme styles in the Styles.xml file, there are generally two types of inheritance:
    1. Inherit Android Theme

      <style name= "Appbasetheme" parent= "Android:Theme.Holo" >

      If you rewrite the style, you need to add Android to the name :You can see the parent reference parent= "android:Theme.holo"

      <item name= "Android:actionbarstyle" > @style/myactionbar</item>

    2. Inherit AppCompat theme (V7 under Package topics)

      <style name= "Apptheme" parent= "Theme.AppCompat.Light.DarkActionBar" >

      If you rewrite the style, you don't need to add Android to the name :You can see that the parent reference does not have "Android:".

      <item name= "Colorprimary" > @color/colorprimary</item>
      <item name= "Colorprimarydark" > @color/colorprimarydark</item>
      <item name= "Coloraccent" > @color/coloraccent</item>

Summary: The theme that should be custom inherited from ANDROIDSDK needs to be added "Android:", custom Inheritance V7 under the theme of the package is not required .

Android Theme Theme Inheritance (SDK under Themes and V7 package under themes)

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.