Overriding referenced style attributes

前端 未结 1 1025
一生所求
一生所求 2020-11-27 07:29

After reading through References To Theme Attributes I am trying to reference the value of an attribute in the my custom theme that I have set.

I am applying a user-d

相关标签:
1条回答
  • 2020-11-27 08:15

    I think you need that line in your theme

    <item name="android:checkedTextViewStyle">@style/ListViewCheckedTextViewRowStyle</item>
    

    so it would look like this:

    <style name="Theme.Yellowgreen" parent="android:Theme.Holo.Light.DarkActionBar">
        <item name="android:listChoiceIndicatorMultiple">@drawable/btn_check_holo_light</item>
        <item name="android:checkedTextViewStyle">@style/ListViewCheckedTextViewRowStyle</item>
    </style>
    

    UPDATE

    After question update and some additional information form comments we found that the problem was in Context. It's the same mistake I did in that my question: Android color selector doesn't work with custom attributes

    To one fragment was passed Activity and to the other Application. I'm not an expert but even both of those classes are extending Context only the Activity extends ContextThemeWrapper, which has information about styles. It might be helpful to read that article for future understanding Context: http://www.doubleencore.com/2013/06/context/

    0 讨论(0)
提交回复
热议问题