Android Selector Drawable doesnt work with attributes

后端 未结 4 1154
猫巷女王i
猫巷女王i 2020-12-14 12:13

I am using attr to create a selector drawable for my project so that once i change theme colors, i dont have to make any change in the drawable file. I am using following li

4条回答
  •  醉酒成梦
    2020-12-14 13:13

    Finally, found the problem. There is a bug in android [pre-lollipop] OS which doesnt allow you to use attr in drawable. Here is the link to bug:

    https://code.google.com/p/android/issues/detail?id=26251

    Android dev team has released a fix but it works on android L and above.For workaround to this problem, refer to following solution:

    How to reference style attributes from a drawable?

提交回复
热议问题