【问题标题】:Android Exception loading 9-patch imageAndroid Exception 加载 9-patch 图片
【发布时间】:2013-05-23 15:55:07
【问题描述】:

我正在尝试为 PhoneGap Android 实现一个 9 补丁启动画面,但我不断收到编译器异常。

我有一个 res/drawables/splash.xml 包含:

<nine-patch xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/splashimg" 
android:dither="false"/>

我已将 splashimg.9.png 保存到 res/drawable。 (使用a test 9-patch image 取自Android splash screen image sizes to fit all devices

我的 DroidGap 文件中有以下内容:

super.setIntegerProperty("splashscreen", R.drawable.splash);

然而,当我尝试构建时,我得到:

org.xmlpull.v1.XmlPullParserException: Binary XML file line #1: <nine-patch> requires a valid 9-patch source image

有什么想法吗?我可以正常启动闪屏,但不是 9-patch...

【问题讨论】:

  • 检查您的 9 补丁是否在可绘制文件夹中,您可以发布它
  • @IftikarUrrhmanKhan 我从i.stack.imgur.com/AZv2V.png 下载了示例图像,并将其作为 splashimg.9.png 保存到 drawable 文件夹中。
  • 这不是有效的 9 补丁图像
  • @IftikarUrrhmanKhan 你知道为什么吗?我从stackoverflow.com/questions/10574363/… 的教程中借来的。我认为这是有效的..

标签: android cordova nine-patch


【解决方案1】:

发现问题。我在 res/drawable 目录中只有 XML 和 9.png 文件。我将它们放入其他四个目录后,一切都开始正常工作了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-08-25
    • 1970-01-01
    • 2011-07-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多