简体   繁体   中英

Confusion with my layouts - android

I'm currently working on my application, which tries to support different screen resolutions but I noticed a major problem with my layouts. I'll explain:

I have two folders in my res folder. They are called "layout" and "layout-sw360dp" which is meant to support big screens like Samsung Galaxy S4, HTC One, etc. Now, when I try to run my application on my private phone, galaxy S4, the app looks fine and all of the images and the components are perfect.

But when I try to run my app on an HTC One device, suddenly the layout looks small, like very small. It supposes to fit the entire screen, like in my galaxy s4. It's like HTC One and Galaxy S4 don't use the same layout folder, although their screens sizes are almost the same.

If you guys can clarify this matter for me I would really appreaciate that.

Edit: I have tried to run my app on an Samsung Galaxy S5 device and it looks find, like the way it should. What is the problem with HTC One?

Physical size is usually measured in inches, it simply tells you the real device's screen size

dpi, is NOT correlated with it. Dpi expresses screen density, how many pixels are shown in a given area (usually a square inch). It could be considered as a measure of screen quality.

Resolution is given by the product of the two; it expresses the total number of physical pixels on a screen.

android:anyDensity="true"

Samsung Galaxy S4, HTC One have different physical size : DIFFERENCE

Refer this for how to choice best resolution : DOC

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