Android method for changing font size and color anywhere in textview

Two methods are introduced here: spannable and html.fromhtml (changed by HTML tags). In practice, you can choose which one you want to use

1. Use of html.fromhtml

The above is the effect without HTML tag, and the following is the effect with HTML tag:

2. Use spannable to implement

The spannable effect is as follows:

Is it very simple, but the effect is powerful, hurry to realize it!!!

The above Android method to change the font size and color anywhere in textview is all that Xiaobian has shared with you. I hope it can give you a reference and support more programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>