How to get rid of the underline in a Spannable String with a Clickable Object?

后端 未结 10 2035
陌清茗
陌清茗 2021-02-03 16:44

I have a Spannable Object with a Clickable Object set to it. When the Spannable String is displayed in the TextView it has bl

10条回答
  •  面向向阳花
    2021-02-03 17:11

    spannableStringObject.toString();

    Edit

    SpannableString ss = getYourSpannableString();
    UnderlineSpan[] uspans = ss.getSpans(0, ss.length(), UnderlineSpan.class);
    for (UnderlineSpan us : uspans) {
        ss.removeSpan(us);
    }
    

    Will remove all the UnderlineSpans from the Spannable.

提交回复
热议问题