SpannableStringBuilder to create String with multiple fonts/text sizes etc Example?

后端 未结 9 1543
眼角桃花
眼角桃花 2020-11-28 03:00

I need to create a String placed in a TextView that will display a string like this:

First Part Not Bold BOLD rest not bold

9条回答
  •  孤街浪徒
    2020-11-28 03:38

    Why would you use SpannableStringBuilder when you can use SpannableBuilder?? (https://gist.github.com/qtyq/90f9b4894069a8b3676c)

    SpannableString ss = SpannableBuilder.init("First Part Not Bold BOLD rest not bold")
                                         .makeBold("BOLD")
                                         .create()
    

提交回复
热议问题