Change Drawable Based on Theme

后端 未结 1 374
北恋
北恋 2020-12-04 10:51

I\'ve got an image in two different colors, corresponding to two different themes in Android. I want to use them in my Action Bar. I want to refer to a drawable for the ic

1条回答
  •  有刺的猬
    2020-12-04 11:11

    Seems like I'm always just a Google search or two away from my answers. The solution is:

    in styles.xml

    
    

    then in the actual theme:

    @drawable/buttonface_picture_dark
    

    or

    @drawable/buttonface_picture_light
    

    Then, in the menu.xml:

    
    
    

    The Accessing Resources Page combined with this SO eventually got it to click in my brain.

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