StateListDrawable in ListView strangely off-colored in certain conditions

后端 未结 1 1861
挽巷
挽巷 2021-01-23 17:58

I have created a ListView with TextViews as items - most of which have a certain color as background, but some have a custom @drawable/shape as background (i.e. the top and bott

相关标签:
1条回答
  • 2021-01-23 18:28

    After endless research and guesswork, I've found the reason myself: Dithering! By disabling dithering in the state-list selectors, the problem magically disappeared:

    <selector xmlns:android="http://schemas.android.com/apk/res/android" android:dither="false">
    

    It seems that dithering is only applied under certain conditions (as described above) which is IMHO not expected behaviour, yet treatable by disabling it completely.

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