Difference between android dimension: pt and dp

前端 未结 7 1948
迷失自我
迷失自我 2020-11-30 18:28

The documentation says that 160 dp (density-independent) equals 1 inch. And 72 pt is also 1 inch. So I don\'t see why android define a dp measurement while it seems to work

7条回答
  •  醉话见心
    2020-11-30 19:10

    Why should I use dp if I can use pt?

    Developers are used to thinking of things in terms of pixels. Density-independent pixels was Android's way of getting close to what developers are used to. That being said, you are welcome to use points, inches, or millimeters if you prefer.

提交回复
热议问题