1

There are 2 ways to specific text size in EditText

  • android:textSize
  • android:ems

Most of the time, I am using android:textSize in sp unit

I was wondering, in what situation, we should use android:ems ( I do understand the meaning of ems from What is meant by Ems? (Android TextView) )

Cheok Yan Cheng
  • 47,586
  • 132
  • 466
  • 875

2 Answers2

0

one em in a 16-point typeface is 16 points

em is more predefined while textSize using sp is specific. It depends on your use case.

Sidenote: You can also set an EditText's text size by using textAppearance.

jbmcle
  • 771
  • 3
  • 12
0

You should very rarely use ems. Ems doesn't scale. It means your text is always a fixed height. This makes your app difficult to read for people who have vision problems. You should only use it if your app will absolutely not work correctly with scaled text and you don't care how that effects the disabled.

Gabe Sechan
  • 90,003
  • 9
  • 87
  • 127