支持多屏幕的最佳方法? - Android电子 [英] Best way to support multiple screens? - Android

查看:147
本文介绍了支持多屏幕的最佳方法? - Android电子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直对我的应用程序了好几个月,现在,它即将准备发布。我还有一件事要做,这是使其支持多个屏幕。我已阅读了Android开发者文档很多次,但我仍然困惑,什么是最好的方式来实现,这可能是。

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.

感谢先进的帮助!

推荐答案

如果您希望不同的布局不同的屏幕,那么,你就需要为每个单独的布局。如果你想同样的布局,只是规模,那么所有你需要做的是确保所有尺寸都在DP或SP,不要在任何地方使用像素。 Android将采取其他的事情。

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.

至于图片去,你应该让他们在不同的分辨率,即使你没有单独的布局,因此他们希望在不同的屏幕密度更好。我会说,至少有每个图像的MDPI和华电国际的决议。

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.

这篇关于支持多屏幕的最佳方法? - Android电子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆