布局720 * 1280设备布局、设备

2023-09-05 04:14:17 作者:情绪操控生活

我已经寻找一个完全相似的话题/问题,但没有找到。我的问题是,720 * 1280布局(Galaxy Nexus的)和480×800的布局(歌Nexus S)正在使用相同的布局。我创建了布局布局大布局小布局XLARGE 文件夹/布局,我支持现在更加设备的分辨率,但是,我有一个比例问题,720 * 1280,也480 * 854, 480 * 800的分辨率。我的问题是,我可以做一个具体的布局特定的分辨率?我总是用保证金左​​/右,它可以为特定的分辨率来工作而不是其他。 谢谢你。

I have searched for an exactly similar topic/problem but didn't find. My problem is that 720*1280 layout(Galaxy Nexus) and 480*800 layout(Nexus S) are using the same layout. I have created layout, layout-large, layout-small, layout-xlarge folders/layouts and I'm supporting now a much more devices resolution, however, I have a scaling problem with 720*1280 and also 480*854 , 480*800 resolutions. My question is can I make a specific layout for a specific resolution? I'm always using margin left/right and it can work for a specific resolution and not in other. Thank you.

推荐答案

见下面的链接

Samsung Galaxy Nexus的布局/绘制结构?

Which Android的布局和资源绘制星系应该发展选项卡支持?

如果你希望你的应用程序以支持最大的设备,尽量使这适合于所有设备的通用布局,有可能轻微的折衷,但可以忍受的。您可以通过使用相对布局尽可能做出这样的布局,如果来了一个情况下,你不能处理多设备支持,尝试用code运行时处理,但以这样的方式,它运行所有的设备上(对于-例想到的百分比,而不是固定的高度或宽度等)

If you want your App to support maximum devices, try to make a general layout which fits for all device, there may be minor trade offs, but one can live with that. You can make such a layout by using Relative Layout as much as possible, if there come a situation where you can not handle multiple device support, try handling it with code at run time, but in such a manner, that it runs on all device (For-Example think of percentages instead to fixed height or widths etc)