1

I have values-xxhdpi folder having dimens.xml file, i set the font size 34sp in nexus 5. When I put this on the samsung s5 the font looks very small. Is there any possible way of having the font size look the same (size wise) on both devices?

android:textSize="@dimen/font_size_34sp"

I have find screen size difference Nexus5 4.9" S5 5.1"

Provide me generic solution, if possible I want to be able to do this in XML.

ahcox
  • 9,349
  • 5
  • 33
  • 38
Asif
  • 647
  • 9
  • 18

1 Answers1

0

You could have a method at run time (onCreate) to get the screen dimensions then based on that re-size the font dynamically.

As different phones have the same DPI but different screen dimensions.

Please also view this

Community
  • 1
  • 1
Kurdish Droid
  • 279
  • 3
  • 15
  • I have checked this link but same problem i want to do from xml – Asif Feb 10 '15 at 11:58
  • 1
    That is not possible from XML because you want to get dimensions and base the font size on that. Surely a simple method would be easy and hassle free? why do you need it in XML? – Kurdish Droid Feb 10 '15 at 11:59