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. ?
for set text size in android (java or kotlin) just use SP
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With