Can't convert to color: type=0x2 error when inflating layout in fragment but only on Samsung Galaxy and Note 4

后端 未结 4 1906
予麋鹿
予麋鹿 2020-12-05 17:25

I am working on a simple app with an activity and i use fragments.One screen with some elements. When i compile and run the app it works fine, except on Samsung Galaxy s3 an

4条回答
  •  隐瞒了意图╮
    2020-12-05 17:40

    I faced the same issue, that was caused by using attributes as a reference to color in an XML drawable.

    As mentioned here on API < 21 you can't use attrs to color in the XML drawable. So only way is to use a reference to a color resource (@color/YOURS_COLOR) or use #RGB format.

    So if you want to use an XML drawable with theme depended colors you should create a drawable for each theme.

提交回复
热议问题