How will \t be treated while formatting a textview in Android. Would it be different from screen size to screen size? Is there any alternative for it be similar in all screen sizes?
Asked
Active
Viewed 38 times
-1
-
use [Constraintlayout](https://medium.com/exploring-android/exploring-the-new-android-constraintlayout-eed37fe8d8f1). – Abhay Koradiya May 15 '18 at 06:20
-
I meant in Textview. – nandu May 15 '18 at 06:22
-
1use the `textsize` in `sp` instead of `dp` – Masoom Badi May 15 '18 at 06:23
1 Answers
1
TextView size would vary from device to device based on the screen size and text size you give in your XML design. You can give textSize
in sp
Example: android:textSize="10sp"
Based on the screen size, Android will convert sp
size into pixels
.
You can refer this SO Answer on how conversion works. You can read more about TextView from official document here.
Hope this helps.

Naveen T P
- 6,955
- 2
- 22
- 29