среда, 14 мая 2014 г.

Set TextSize programatically to Android TextView

As you probably know you should set TextSizes in sp units (other dimensions in dp). It is scale-independent pixels. 
So, you should set in your dimens file 
   
dimen name="month">32sp

Programatically you can set this textsize by 
    textview_name.setTextSize(TypedValue.COMPLEX_UNIT_PX,         getResources().getDimension(R.dimen.month));

Other combination incorrect.

Комментариев нет:

Отправить комментарий