9 补丁图像阻止应用程序在 Android 中运行

发布于 2024-12-22 18:23:58 字数 1039 浏览 2 评论 0原文

我为我的启动画面创建了一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

離人涙 2024-12-29 18:23:58

PhoneGap 官方代表在回答“PhoneGap Build 是否支持使用 9 补丁镜像”的问题时表示:

似乎唯一支持它们的平台是 Android。由于我们目前正在努力实现跨平台,因此这似乎有点难以抉择。然而,这是我们未来可能会进一步研究的事情。

取自: 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":

The only platform that seems to support them is Android. Since we strive for cross platform currently it seems to be a bit of a toss up. However it is something we may look into further down the road.

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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文