9 补丁图像阻止应用程序在 Android 中运行
我为我的启动画面创建了一个 9 补丁图像 (splash.9.png)。问题是,每当我使用此启动图像时,应用程序都不会超出启动屏幕。但是,使用非 9patch 图像可以使应用程序正常运行。没有 .9 扩展名的相同 9 补丁图像也可以使该应用程序正常运行。可能有什么问题??
代码:
public class NafapplicationActivity extends DroidGap {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.setIntegerProperty("splashscreen", R.drawable.splash);
super.loadUrl("file:///android_asset/www/index.html");
}
}
index.html:
<!DOCTYPE html>
<!--<html manifest="naf.manifest">-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Naf</title>
<script type="text/javascript" charset="utf-8" src="phonegap-1.3.0.js"></script>
</head>
<body>
Hello World!!
</body>
</html>
I have created a 9-patch image (splash.9.png) for my splash screen. The issue is, whenever I use this splash image, the app doesn't go past the splash screen. However, using a non-9patch image makes the app work. The same 9-patch image without that .9 extension also makes the app work. What is possibly wrong??
Code:
public class NafapplicationActivity extends DroidGap {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.setIntegerProperty("splashscreen", R.drawable.splash);
super.loadUrl("file:///android_asset/www/index.html");
}
}
index.html :
<!DOCTYPE html>
<!--<html manifest="naf.manifest">-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Naf</title>
<script type="text/javascript" charset="utf-8" src="phonegap-1.3.0.js"></script>
</head>
<body>
Hello World!!
</body>
</html>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
PhoneGap 官方代表在回答“PhoneGap Build 是否支持使用 9 补丁镜像”的问题时表示:
取自: http://community.phonegap.com/nitobi/topics/does_phonegap_build_support_the_use_of_9_patch_images
所以,回答你的问题:你的飞溅不起作用当它是
.9.png
时,因为 PhoneGap 不支持,也可能永远不支持 9 补丁图像,因为 Android 是唯一支持它们的主要平台,而 PhoneGap 是一个跨平台框架。希望有帮助!
Official Rep from PhoneGap says, in response to the question "Does PhoneGap Build support the use of 9-patch images":
Taken from: http://community.phonegap.com/nitobi/topics/does_phonegap_build_support_the_use_of_9_patch_images
So, to answer your question: Your splash doesn't work when it is a
.9.png
because PhoneGap doesn't, and may never, support 9-patch images because Android is the only major Platform to support them and PhoneGap is a Cross-Platform Framework.Hope that helps!