Screen Size and Screen Density Samsung S I9000

I have problems with the application on the Samsung S I9000. The buttons in my application are much larger than they should be. In addition, the system selects res / values-small / as the source of the values. In general, it acts as if the device has a very small screen, although it is supposedly 800x480 (I work in landscape mode). In fact, I can improve the situation by changing the values ​​in res / values-small / styles.xml to even smaller font sizes than I already used.

Display metrics are as follows:

 density = 2.0
 scaledDensity = 2.0
 densityDpi = 320
 widthPixels = 800
 heightPixels = 480
 xdpi = 320.0
 ydpi = 320.0

Can someone explain why the device scales my graphics so much and acts as if I have a very small display? More importantly, how can I fix this?

I tried setting up my manifest to install minSdk and targetSdk in a recent version, but that did not affect. Removing the-small / values ​​made the application use the default values ​​/ instead, which only made things worse.

0
source share
1 answer

Always use "sp" for the font and relax as "dp"

put your image in the appropriate folder below

Suppose you are using 36x36 image 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

There are some situations in which you do not want Android to pre-scale the resource. The easiest way to avoid prior scaling is to place the resource in the resource directory using the nodpi configuration specifier.

:

res/drawable-nodpi/icon.png

, 14sp , 320 DPI

14×320÷160 =28

28dp xhdpi.

+2

All Articles