我很困惑与绘制,华电国际和绘制,MDPI [英] I am confused with drawable-hdpi and drawable-mdpi

查看:106
本文介绍了我很困惑与绘制,华电国际和绘制,MDPI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让我的Andr​​oid应用程序工作在两种类型的手机设备和平板电脑。对于布局我有布局正常和布局,大型和我把里面的每一个我的XML文件,它似乎选择正确的每个设备(布局,正常的手机和布局,大型的平板电脑)。

i am attempting to get my android app to work on both phone type devices and tablets. for the layouts i have layout-normal and layout-large and i place my xml files inside each and it seems to select the correct one for each device (layout-normal for phones and layout-large for tablets).

但问题出现了绘制的文件夹。我有绘制,华电国际,绘制,MDPI和绘制,LDPI。平板电脑从绘制,MDPI取其图像,手机从绘制,华电国际采取的图像。从读书我一直在做,这似乎是倒退???这似乎发生在两个模拟器和真正的设备,可我做错了什么?我是混合的东西了?

however the problem arises for the drawable folders. i have drawable-hdpi, drawable-mdpi and drawable-ldpi. the tablet is taking its images from the drawable-mdpi, and the phone is taking its images from the drawable-hdpi. from the reading i have been doing this seems to be backwards??? this seems to happen on both the emulator and real devices, could i be doing something wrong? am i mixing something up?

推荐答案

克莱顿,

抽拉-HDPI和抽拉-MDPI是不相关的画面本身的大小,而到了显示器的分辨率。

drawable-hdpi and drawable-mdpi is not related to the size of the screen itself, but to the resolution of the display.

这可能很容易想到在iPhone 3GS和4这方面(和我一起承担,请)。 4拥有Retina显示屏,所以一个更高的分辨率。使用你与3GS使用相同的子画面将导致模糊的显示。

It's probably easy to think in terms of the iPhone 3GS and 4 for this (bear with me please). The 4 has retina display, hence a much higher resolution. Using the same sprites you'd use with the 3GS would result in a blurry display.

Android手机,如果有的话,太多的屏幕选择方面更加多样化。

Android phones are, if anything, much more diverse in terms of screen options.

如果您希望能够在不同的分辨率,以瞄准不同的布局,请尝试将布局成/布局XLARGE,/布局大型,等等...

If you want to be able to aim different layouts at different resolutions, please try putting the layouts into /layout-xlarge, /layout-large, etc...

您可以在这里找到更多的:

You can find more here:

<一个href="http://developer.android.com/guide/practices/screens_support.html">http://developer.android.com/guide/practices/screens_support.html

有一些变化,你可以为Android 3.2及以上参见:

There are some changes that you can see for Android 3.2 and above:

开始采用Android 3.2(API级别13),上述尺寸群体   德precated,你应该改用swdp配置   预选赛定义所规定的最小可用宽度您   布局资源。例如,如果你的多面板的平板布局   至少需要600dp屏幕宽度,你应该把它放在   布局sw600dp /。使用新技术来声明布局   资源进一步有关声明平板讨论了部分   布局为Android 3.2。

Beginning with Android 3.2 (API level 13), the above size groups are deprecated and you should instead use the swdp configuration qualifier to define the smallest available width required by your layout resources. For example, if your multi-pane tablet layout requires at least 600dp of screen width, you should place it in layout-sw600dp/. Using the new techniques for declaring layout resources is discussed further in the section about Declaring Tablet Layouts for Android 3.2.

这篇关于我很困惑与绘制,华电国际和绘制,MDPI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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