Button setText with Spannable doesn't work for Android 5.0 Lollipop

前端 未结 1 1090
刺人心
刺人心 2020-12-06 16:23

I have a simple Button:

相关标签:
1条回答
  • 2020-12-06 16:46

    By default, Material buttons are styled to show text in all-caps. However, there is a bug in the AllCapsTransformationMethod used for capitalization that causes it to discard Spannable data.

    You can override the default button styling and disable all-caps by specifying android:textAllCaps="false" on your Button.

    <Button
        ...
        android:textAllCaps="false" />
    
    0 讨论(0)
提交回复
热议问题