Android S3 布局与 Galaxy Nexus 布局 [英] Android S3 layout vs Galaxy Nexus layout

查看:24
本文介绍了Android S3 布局与 Galaxy Nexus 布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一款应用,本应同时针对 Galaxy Nexus 和 Galaxy S3.两者都有 720 x 1280 的屏幕分辨率,我在我的应用中只使用了dp"值.资源位于layout-xhdpi"和drawable-xhdpi"文件夹中.Nexus 上的布局看起来非常好,但 S3 上的填充值(以 dp 为单位)略有偏差.我认为这是因为 S3 上的屏幕尺寸更大且密度不同.

I've developed an app that was supposed to target both the Galaxy Nexus and the Galaxy S3. Both have 720 x 1280 screen resolutions and I have only used 'dp' values in my app. The resources exist in the 'layout-xhdpi' and the 'drawable-xhdpi' folders. Layout looks perfectly fine on the Nexus, but the padding values (in dp) is slightly off on the S3. I assume its because of the bigger screen size on S3 and difference in density.

如何为 Nexus 和 S3 创建一个单独的文件夹,以便考虑不同的屏幕尺寸?

How can I create a separate folder for Nexus and S3 so I can take into account the different screen sizes?

推荐答案

使用这个方案:

对于相同的布局横向和纵向layout-sw360dp

For same layout landscape and portrait layout-sw360dp

仅适用于横向layout-sw360dp-land

仅用于纵向layout-sw360dp-port

我想说您可以使用之前的分类来创建具有这些名称的文件夹.位于的布局加载在 Galaxy S3 - WXGA720 中.这是一种区分此类设备布局的方法.其必要的Android 4.0+.

I try to say you can use the before clasification creating folders with theses names. The layout located into are loaded in the Galaxy S3 - WXGA720. This is a way for disting the layout for this type of device. Its necesary Android 4.0+.

这篇关于Android S3 布局与 Galaxy Nexus 布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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