MonoDroid应用程序不使用正确的密度可绘 [英] MonoDroid apps don't use correct density drawables

查看:119
本文介绍了MonoDroid应用程序不使用正确的密度可绘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到了一些非常有趣的测试结果与MonoDroid与不同的屏幕大小和密度不同的设备开发程序的时候。

I am getting some very interesting results when testing an app developed with MonoDroid on different devices with varying screen sizes and densities.

我已经建立了在我的项目如下(简体)文件夹结构:

I have the following (simplified) folder structure set up in my project:

  • 在绘制
    • image.png
    • drawable
      • image.png
      • image.png
      • image.png
      • image.png
      • image.png

      在绘制的图像是一个文件夹。在其他文件夹中的图像是除了尺寸和被吸入在顶部,以表明它是从(例如,L,M,H,或X),这取决于该文件夹在其上的密度的信相同。

      The image in drawable is that of a folder. The images in the other folders are identical except for the size and a letter that is drawn on top to indicate which density it is from (e.g. L, M, H, or X) depending on the folder.

      无论设备的屏幕密度显示该应用的图像被从被拉伸-MDPI夹拉动。(使用Android.Util.DisplayMetrics认证)

      Regardless of the device's screen density (verified using Android.Util.DisplayMetrics) the images displayed for the app are being pulled from the drawable-mdpi folder.

      我创建Eclipse的一个快速测试应用程序,使用相同的XML布局文件和相同的一组图片。启动我的各种设备的应用程序显示正确的图像。

      I created a quick test app in Eclipse that used the same xml layout file and the same set of images. Launching that app on my various devices displays the correct image.

      我在一个完全丧失,这已经花了我2天诊断和最后检测的问题的原因的大部分。

      I'm at a complete loss and this has now cost me the better part of 2 days diagnosing and finally detecting the cause of the problem.

      有没有人能解决这个问题?在此先感谢!

      Has anyone been able to overcome this problem? Thanks in advance!

      推荐答案

      与Xamarin聊天支持后,事实证明,这个问题是有关一个不正确的Andr​​oidManifest.xml文件...

      After chatting with Xamarin support it turns out that the problem was related to an incorrect AndroidManifest.xml file...

      它没有在<使用的SDK>标签设置正确?

      It didn't have the <uses-sdk> tag set correctly...

       <uses-sdk /> <!-- Why in the world this is the default I'll never know! -->
      

       <uses-sdk android:minSdkVersion="8" targetSdkVersion="8"/>
      

      彻底解决了这个问题。

      completely solved the problem.

      希望其他人发现这很有用!

      Hope others find this useful!

      这篇关于MonoDroid应用程序不使用正确的密度可绘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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