How to set text size of textview dynamically for different screens

The Solution to How to set text size of textview dynamically for different screens is


EDIT: And As I Search on StackOverflow now I found This Question is Duplicate of : This and This

You need to use another function setTextSize(unit, size) with unit SP like this,

tv.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18f);

Please read more for TypedValue constants.

~ Answered on 2012-02-29 05:38:40


Most Viewed Questions: