Problems encountered in development - AppCompatTextView uses adaptive font size problems in ListView and GridView

Since the long end of the content to be displayed is not fixed, there may be problems with text wrapping or incomplete display when using ordinary TextView for display.

In order to solve this problem, I adopted the officially recommended control AppCompatTextView. The specific usage method is not explained in this article, you can check it if you need it

https://blog.csdn.net/zhangphil/article/details/79942428

Since I am using this control in the listView, I encountered the situation that the AppcompatTextView font in other items is also reduced due to the multiplexing mechanism of the listView during the sliding process.

In order to solve this problem, I turned on the display layout boundary function in the developer options, and then I found that the height of the items with smaller font size also became smaller as the font size became smaller.

I tried to fix the height of the control and found that the problem was solved . When the text is too long, the font of the control becomes smaller. When the listView is reused for items with short text, it can become the textSize we set at the beginning.

Guess you like

Origin blog.csdn.net/just_hu/article/details/102957767