Best way to support multiple screens? - Android

纵饮孤独 提交于 2020-01-04 13:36:53

问题


I have been working on my app for several months now, and it is about ready to be released. I have one more thing to do, which is to make it support multiple screens. I have read the the android developer documentation many times, but I am still confused as to what the best way to implement this might be.

Should I create multiple layout files for each screen type & resolution I want to support? If I did that, then I would have to render multiple pictures for each resolution and that would be cumbersome for someone to download.

Thanks for the help in advanced!


回答1:


If you want different layouts for different screens, then yes, you'll need separate layouts for each. If you want the same layouts to just scale, then all you need to do is make sure all of your sizes are in dp or sp, don't use px anywhere. Android will take care of the rest.

As far as images go, you should have them in different resolutions even if you don't have separate layouts so they look better in varying screen densities. I'd say at least have mdpi and hdpi resolutions of each image.



来源:https://stackoverflow.com/questions/12976831/best-way-to-support-multiple-screens-android

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