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

后端 未结 10 2143
陌清茗
陌清茗 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:20

    Raghunandan's answer works perfectly for me. Here is a pared-down version of it:

    public abstract class NoUnderlineClickableSpan extends ClickableSpan {    
        public void updateDrawState(TextPaint ds) {
            ds.setUnderlineText(false);
        }
    }
    

提交回复
热议问题