简体   繁体   中英

Does 15dp represent the same physical size (say 7millimeters on screen) in every device? (Android)

I found many definitions for 'dp' among the answers, but none of these answered this exact question.

It is said 'dp' is dpi independent.

So if you draw a line of 50dp programatically in your app and measure its actual size using a ruler(a tangible plastic ruler) and do this in 10 different devices with different screen sizes you will get the same length on the ruler?

On 10 different devices with different configurations, will I get the same length on the ruler with a 50dp line drawn?

Simplest answer, NO

However, it is very close! And that is all that matters.

For a 48 x 48 dp touch target... Physical size on any device will be a square of size 9 ± 2mm

Check out this link from Google: https://www.google.com/design/spec/layout/metrics-keylines.html#metrics-keylines-touch-target-size

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