Removing style from selected text in edittext

前端 未结 3 1423
忘掉有多难
忘掉有多难 2021-01-06 03:59

My app should allow users to style inputted or selected text in an Edittext. Some of these styles are Underline, Strike through, Bold and Italic. They are easily added but I

3条回答
  •  我在风中等你
    2021-01-06 04:01

    android.graphics.TYPEFACE.Default returns a Typeface, and the StyleSpan constructor takes an int as paramater.

    Try using :

    android.graphics.Typeface.DEFAULT.getStyle() 
    

    instead of:

    android.graphics.Typeface.DEFAULT
    

提交回复
热议问题