there are 2 methods to set the textsize of a textview. The one I am interested in setTextSize (int unit, float size). I am unable to find the int list for all the units (dp, sp,..). Anybody knows what are the int values of those units in Android? tHANKS
Share
Via the API…
sp:
TypedValue.COMPLEX_UNIT_SPdip:
TypedValue.COMPLEX_UNIT_DIPTake a look at the constants of the
TypedValueclass for all the possible units.http://developer.android.com/reference/android/util/TypedValue.html
http://developer.android.com/reference/android/widget/TextView.html#setTextSize(int, float)
You can also convert to pixels dynamically: http://developer.android.com/guide/practices/screens_support.html#dips-pels
Hope that helps!