Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is textview.setTextSize()?

In my android game, there is a textview. I am setting the text size using following code.

textview.setTextSize(30);

30 is in pixels. But what exactly it is ? Is it the height or width of a character ? Is it ordinal no. ?

like image 974
user3293494 Avatar asked May 11 '14 09:05

user3293494


1 Answers

for set text size in android (java or kotlin) just use SP

textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);
like image 75
Rasoul Miri Avatar answered Sep 30 '22 12:09

Rasoul Miri