Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is android:includeFontPadding for?

Tags:

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?
like image 451
Vas Avatar asked Feb 28 '16 09:02

Vas


People also ask

What is includeFontPadding?

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.

What is the purpose of TextView?

A TextView displays text to the user and optionally allows them to edit it. A TextView is a complete text editor, however the basic class is configured to not allow editing.

What is EMS in android?

ems is a unit of measurement. The name em was originally a reference to the width of the capital M. It sets the width of a TextView/EditText to fit a text of n 'M' letters regardless of the actual text extension and text size. Eg : android:ems Makes the EditText be exactly this many ems wide.

What is edit view in android?

In Android, EditText is a standard entry widget in android apps. It is an overlay over TextView that configures itself to be editable. EditText is a subclass of TextView with text editing operations. We often use EditText in our applications in order to provide an input or text field, especially in forms.


1 Answers

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.

enter image description here

like image 153
Wackaloon Avatar answered Oct 19 '22 07:10

Wackaloon