PhoneGap iPad 启动屏幕不适合
我创建了一个与 iPhone 和 iPad 兼容的应用程序。因为它基于 HTML (PhoneGap),所以应用程序本身对于两种设备来说是相同的(HTML 可以很好地扩展!)。 但是启动屏幕图像在启动时不会填满 iPad 上的显示。
在我的资源文件夹中只有 iPhone 启动图像,对于 iPad 来说太小了,我如何添加另一张对于iPad?
I created an App which is compatible to iPhone and iPad. Because it is based on HTML (PhoneGap) the App itself is the same for both devices (HTML scales well!). But the launch screen image does not fill out the display on the iPad upon launch.
In my Resorces folder there is only the iPhone launch image which is to small for the iPad, how can I add an other one for the iPad?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
您需要在应用程序的 info.plist 中指定启动图像文件 (
UILaunchImageFile
) 属性:例如,如果您将
UILaunchImageFile~ipad
键的值设置为iPad
,您的文件名应为iPad-Portrait.png
和iPad-Landscape.png
。您可以类似地为 iPhone 更改它,或使用 iPhone 的默认值 (Default.png
)。这是在 信息属性列表文件。
You need to specify the launch image file (
UILaunchImageFile
) property in your application's info.plist:For example, if you set the value for the key
UILaunchImageFile~ipad
toiPad
, your file names should beiPad-Portrait.png
andiPad-Landscape.png
. You could similarly change it for the iPhone, or use the default (Default.png
) for iPhone.This is defined in Information Property List Files.
嘿,我找到了这个问题的解决方案,使用phonegap 1.9将此代码放入您的应用程序委托中应该可以解决问题:
需要在[ super applicationDidFinishLaunching:application ]调用之后进入“applicationDidFinishLaunching”函数。
Hey, I've found a solution to this issue, using phonegap 1.9 dropping this code into your apps delegate should do the trick:
That needs to go in the 'applicationDidFinishLaunching' function after the [ super applicationDidFinishLaunching:application ] call.
您需要如上所述指定启动图像,但还要检查以确保构建后启动图标位于正确的位置。构建/运行 PhoneGap 项目后,检查 xcode 中的 Resources 文件夹。我发现我的额外启动屏幕和应用程序图标尚未在构建中移动到那里。当我手动复制它们并重新构建后,所有图标和启动屏幕都像 ipad 和 iphone 一样工作。
You need to specify the launch image as mentioned above, but also check to make sure that after the build your launch icons are in the right place. After doing a Build/Run of a PhoneGap project, check the Resources folder in xcode. I found that my additional launch screens and app icons hadn't been moved there in build. Once I copied them in manually and re-built, all the icons and launch screens worked as they should for ipad and iphone.
我也有同样的问题。我尝试了一大堆解决方案,这些解决方案是在这里和网上提出的。什么都没起作用。我的问题是我正在使用部署目标 < iOS 3.2 不支持他的帖子中描述的 Info.plist 设置Mo.。
不幸的是,Apple 有几个关于 Info.plist / 闪屏问题的文档。这一个有帮助:
http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BuildTimeConfiguration/BuildTimeConfiguration.html#//apple_ref/doc/uid/TP40007072-CH7-SW18
您可以这样设置您的项目:
在 Info.plist 中不要进行“启动图像”设置。只需添加以下图像:
Default.png
-->这是(大)iPad 启动图像Default-Landscape.png
-->这是(大风景)iPad 初始图像Default-Portrait.png
-->这是(大肖像)iPad 启动图像Default~iphone.png
-->这是(小)iPhone 初始图像为了支持高分辨率显示:
Default@2x~iphone.png
--> -->这是(视网膜)iPhone 初始图像I had the same problem. I tried a whole bunch of solutions, which were proposed here and on the net. Nothing worked. My Problem was that I'm using a deployment target < iOS 3.2 which does not support the Info.plist settings Mo. described in his post.
Unfortunately Apple has several documentations on the Info.plist / splash screen matter. This one helped:
http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BuildTimeConfiguration/BuildTimeConfiguration.html#//apple_ref/doc/uid/TP40007072-CH7-SW18
You set up your project like this:
Make no "Launch image" settings in Info.plist. Just add the following images:
Default.png
--> This is the (big) iPad splash imageDefault-Landscape.png
--> This is the (big landscape) iPad splash imageDefault-Portrait.png
--> This is the (big portrait) iPad splash imageDefault~iphone.png
--> This is the (small) iPhone splash imageTo support high-resolution displays:
Default@2x~iphone.png
--> --> This is the (retina) iPhone splash image您需要将一个名为“Default.png”的文件放入您的资源 - 启动文件夹中。这将删除它,是的,我知道这听起来很愚蠢,因为它是一个 IPAD 应用程序,但如果您不想触及 C 代码,只需添加或替换该文件即可。即使它是 IPAD,它也会被调用(意思是,实际上 default.png 适用于 iphone,但是……无论如何,尝试一下!)
you need to put a file called "Default.png" in your resources - splash folder. This will remove it, yes i know it sounds silly, because it's an IPAD app, but if you don't want to touch the C code, just add or replace that file. It get's called even if it's an IPAD (meaning, actually default.png is for iphone, but ...well whatever, just try it!)
我按照有关将 UILaunchImageFile 密钥添加到 .plist 文件 http://developer.apple.com/library/ios/#documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html。
这可行,但您必须记住将 iPad 图像拖放到 XCode 中。仅仅在文件浏览器中添加文件是不行的,你必须使用Xcode!
I followed the documentation regarding adding the UILaunchImageFile key to the .plist file http://developer.apple.com/library/ios/#documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html .
This works but you have to remember to drag and drop your ipad image into XCode. It will not work by simply adding the file in the file browser, you must use Xcode!