How do dp, dip, dpi, ppi, pixels and inches relate?

前端 未结 5 1131
别那么骄傲
别那么骄傲 2020-12-24 02:33

I was reading dp, dip, px, sp measurements, but I still have some questions about dp/dpi vs ppi vs px vs inch. I am not able to compare them... is an inch the largest?

5条回答
  •  再見小時候
    2020-12-24 02:59

    DP is the resolution when you only factor the physical size of the screen. When you use DP it will scale your layout to other similar sized screens with different pixel densities.

    Occasionally you actually want pixels though, and when you deal with dimensions in code you are always dealing with real pixels, unless you convert them.

提交回复
热议问题