How does Android change the format of some text in the EditText control

When we use the EditText control, we will encounter such a problem. When I input, when I choose to make the text thicker, the text I input will become thicker. When I remove the selection and input the text again, the text is normal.

In this case, people generally think it is very simple. There is a settypeface method in EditText. Just use Edit_ temp.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL)); That's it. But here comes the problem. This method changes the format of all text in EditText. But the format I want is like this: normal format, thicker format, normal format

The above is the whole content of this article. I hope the content of this article can bring some help to your study or work. At the same time, I also hope to support a lot of 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
分享
二维码
< <上一篇
下一篇>>