Using SpannableString[/Builder] and Rich-text

前端 未结 1 1968
感情败类
感情败类 2021-01-24 04:54

I\'m attempting to construct rich-text where the first part says \"Looking for: \" and is bolded, but the rest is NOT bolded. This is my code:

SpannableStringBui         


        
1条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-24 05:41

    If you just need to Bold the part of text, then just use html tags.

    String htmlString="Looking for: Bold and Normal";
    tvLookingFor.setText(Html.fromHtml(htmlString), TextView.BufferType.SPANNABLE);
    

    0 讨论(0)
提交回复
热议问题