简体   繁体   中英

Font size issue in Nexus 5 and Samsung s 5

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM