If I assign an integer value to change a certain text size of a TextView using java code, the value is interpreted as pixel (px).
TextView
px
Now does anyone know how to assign it in sp?
sp
http://developer.android.com/reference/android/widget/TextView.html#setTextSize%28int,%20float%29
Example:
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 65);
2.1m questions
2.1m answers
60 comments
57.0k users