Is dp the same as dip? [duplicate]

偶尔善良 提交于 2019-11-28 20:59:08

Yes, they are the same. There is no difference, its just an alias.

Documentation:

The compiler accepts both "dip" and "dp", though "dp" is more consistent with "sp".

Pratik

dp Density-independent Pixels - an abstract unit that is based on the physical density of the screen. These units are relative to a 160 dpi screen, so one dp is one pixel on a 160 dpi screen. The ratio of dp-to-pixel will change with the screen density, but not necessarily in direct proportion. Note: The compiler accepts both "dip" and "dp", though "dp" is more consistent with "sp".

What is the difference between "px", "dp", "dip" and "sp" on Android?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!