Different Layouts to support different screens in android [closed]

岁酱吖の 提交于 2019-12-12 03:47:03

问题


When I use different layouts to support different screens , should I use dp or px .


回答1:


Always use dp instead of px. There are three distinct but linked concepts to understand here: screen density (pixels per inch/centimeter, or commonly known as DPI from dots per inch in printers), physical screen size (in inches or centimeters) and number of pixels (also known as resolution, in pixels).

HERE is entire answer. Also read This.




回答2:


dp is best because it adjust itself according to the screen size of the device.It varies from device to device but less then pixel.So, always go for dp.



来源:https://stackoverflow.com/questions/13098866/different-layouts-to-support-different-screens-in-android

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