问题
For example, one my desktop one of my 50px wide button is viewed on my desktop it looks like it occupies about 5% of the screen space as expected. But when viewed on my Android device with the same horizontal resolution it looks like it occupies about 15%.
Can anyone explain why this is and what I can do to stop it?
回答1:
Different displays have different pixel sizes. You hear this referenced as DPI, or dots-per-inch, which is physically how many pixels there are per inch. In your case, your desktop has smaller pixels than your Android device (higher DPI), so the 50px takes up less physical space.
You can fix this by specifying a physical size, such as cm
or in
. Check out the spec.
来源:https://stackoverflow.com/questions/15915875/why-when-my-desktop-screen-and-mobile-screen-have-the-same-resolution-dont-they