安卓兼容性
事情是这样的,我正在开发一个使用大量屏幕空间的应用程序,例如,我需要在某些时间显示 3 个列表视图。起初我在我的 Android 3.1 平板电脑上进行测试,但后来我决定让它也能在 Android 2.1 上运行。当我尝试在模拟器上运行该应用程序时,它看起来非常糟糕,屏幕上的空间比 3.1 上的要多得多(甚至在大屏幕上进行测试)。有这方面经验的人知道是否有可能使像我这样的应用程序(屏幕上同时显示很多东西)看起来不错并且与 android 2.1 兼容?
如果可能的话,会有多难?我应该考虑提出两个不同的申请吗?
以下是一些示例图片:
图片丢失 http://dl.dropbox.com/u/ 2490888/android31.png
图片丢失 http://dl.dropbox.com/u/2490888/android21.png< /a>
第一个是我想要的样子。
Here is the thing, I'm developing an application that uses a lot of the screen space, I need to show 3 list views in certain times for example. At first I was testing on my Android 3.1 tablet, but then I decided I wanted to have it playing on Android 2.1 as well. When I tried to play the application the simulator, It looked awfully bad, things much more space on screen then it looked on the 3.1 (even testing it in big screens). Does anyone with experience in this knows if its possible to make an application like my (with lot's of things showing up in the screen at one time) to look good and be compatible to android 2.1?
If its possible, how hard would it be? Should I consider making two different applications?
Here are some example pictures:
Image missing http://dl.dropbox.com/u/2490888/android31.png
Image missing http://dl.dropbox.com/u/2490888/android21.png
The first one is how I want it to look like.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看开发者网站了解支持不同的屏幕尺寸,尤其是他们提到的部分这:
基本上,您应该能够通过根据屏幕尺寸重新排列布局来解决您的问题。
编辑
如果您没有时间调整布局,您可以查看片段。我自己并没有经常使用它们,所以我无法真正为您提供有关如何最好地使用它们的任何指示,但从我在文档中读到的内容来看,它们可能会在您的情况下发挥作用。
Check out the developer site on supporting different screen sizes, especially the part where they mention this:
Basicly you should be able to solve your problem by rearranging your layouts depending on screen size.
EDIT
If you don't have time to fit your layouts you could look into Fragments. I haven't worked with them that much myself, so I can't really give you any pointers on how best to use them, but from what I read in the documentation they might serve a purpose in your situtation.
根据不同范围的设备制作不同的xml布局,并将它们放在不同的布局文件夹中。例如,如果您有 main.xml 作为专为平板电脑设计的布局文件,请将其放入用于选项卡设备的layout-xlarge 中,并将其放入与 Galaxy s2 等手机兼容的其他版本的 main.xml 中,您可以将其放入布局文件夹中并用于较小的设备像 Galaxy Pop 一样,您将专为较小设备设计的 main.xml 放在布局小文件夹中。
Make different xml layout as per different range of devices and put them in different folder of layouts. For example if you have main.xml as your layout file designed for tablet, put it in layout-xlarge for tab devices and other version of main.xml which is compatable with handset like galaxy s2 you out it in layout folder and for smaller devices like galaxy pop you put main.xml which is designed for smaller devices in layout-small folder.