What is android:includeFontPadding for?

江枫思渺然 提交于 2019-11-30 01:13:44

问题


You can use android:includeFontPadding="false" to get rid of the default padding in a TextView. Android docs say this about the attribute:

Leave enough room for ascenders and descenders instead of using the font ascent and descent strictly.

Questions:

  • What does the above mean? What is this padding used for?
  • Is it bad to turn it off and why?

回答1:


This is need for text size measure in height. If you turn it off, text will be forced to be some height, otherwise it will calculate height of each line with ascenders and descenders.



来源:https://stackoverflow.com/questions/35680999/what-is-androidincludefontpadding-for

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!