Android Samsung S I9000 screen size and density issues

前端 未结 1 1662
执笔经年
执笔经年 2021-01-26 01:02

I\'m having problems with an app on the Samsung S I9000. The buttons on my app are much larger than they should be. In addition, the system is selecting res/values-small/ as a

相关标签:
1条回答
  • 2021-01-26 01:38

    Always use "sp" for font and rest as "dp"

    place your image in corresponding folder as below

    suppose your are using 36x36 image in for mdpi you need to use

    drawable-mdpi - 36 x 36
    drawable-hdpi - 48 x 48
    drawable-xhdpi  72 x 72
    

    3:4:6:8 ratio

    There are some situations in which you might not want Android to pre-scale a resource. The easiest way to avoid pre-scaling is to put the resource in a resource directory with the nodpi configuration qualifier.

    For example:

    res/drawable-nodpi/icon.png
    

    for example

    you are using an font size as 14sp means it will automatically change for 320 DPI as

    14×320÷160 =28
    

    so now your font size is 28dp for xhdpi resolution phone.

    0 讨论(0)
提交回复
热议问题