Switch crashes when clicked on Android 5.0

后端 未结 5 622
暗喜
暗喜 2021-02-08 04:28

When clicking on a switch in my app in Android 5.0 the app crashes with the logcat shown below. The logcat doesn\'t reference my code anywhere in it, and this switch has worked

5条回答
  •  春和景丽
    2021-02-08 05:06

    I had the same problem. I solved it by changing:

    android:thumb="@null"
    

    to:

    android:thumb="@drawable/transparent_thumb"
    android:track="@drawable/transparent_track"
    

    transparent_thumb & transparent_track are two png files which are transparent. They have matched size to your customized Switch.

提交回复
热议问题