ReplacementSpan's draw() method isn't called

后端 未结 7 1975
北海茫月
北海茫月 2021-02-08 03:26

I set background in string like that:

spanString.setSpan(new BackgroundColorSpan(color), 0, 3, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);

But I would l

7条回答
  •  盖世英雄少女心
    2021-02-08 04:12

    In case anyone has this problem, I encountered it. What I had to do is to pass a second parameter into the setText() method. My call looked like

    textView.setText(spanned, TextView.BufferType.SPANNABLE);
    

    Hope this helps!

提交回复
热议问题