Using SpannableString[/Builder] and Rich-text

前端 未结 1 1965
感情败类
感情败类 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条回答
  • 2021-01-24 05:41

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

    String htmlString="<b>Looking for: Bold</b> and Normal";
    tvLookingFor.setText(Html.fromHtml(htmlString), TextView.BufferType.SPANNABLE);
    
    0 讨论(0)
提交回复
热议问题