Search This Blog

Wednesday 6 June 2012

How to implement fontsize for multiple density screen in android

Android runs on a variety of devices that offer different screen sizes and densities.

To handle fonts on the multiple screen and densities on android devices you can use the following approach

//get the density
final float densityMultiplier = getResources().getDisplayMetrics().density;

Now you can multiple the densityMultipler with your font size

float fontsize = 10.0f * densityMultiplier;


No comments:

Post a Comment