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;
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