首页 \ 问答 \ 如何在PhoneGap中为iOS设置启动画面(How to set splash screen for iOS in PhoneGap)

如何在PhoneGap中为iOS设置启动画面(How to set splash screen for iOS in PhoneGap)

我正在使用PhoneGapiOS9+创建iOS应用程序。 根据指南,我在Config.xml添加了以下代码来设置启动画面。

// set the cordova plugin 
 <plugin name="cordova-plugin-splashscreen" source="npm" spec="&gt;1.0.0" />

 // set splash screen for iPad only
 <platform name="ios">
    <gap:splash gap:platform="ios" height="2048" src="res/screen/ios/Default-Portrait@2x~ipad.png" width="1536" />
    <gap:splash gap:platform="ios" height="2048" src="res/screen/ios/Default-Portrait@2x~ipad.png" width="1536" />
    <gap:splash gap:platform="ios" height="768" src="res/screen/ios/Default-Landscape~ipad.png" width="1024" />
    <gap:splash gap:platform="ios" height="1536" src="res/screen/ios/Default-Landscape@2x~ipad.png" width="2048" />
</platform>

然后我在'Terminal'中使用了以下命令来生成iOS平台

phonegap build ios --device

它复制iOS平台中的所有启动图像。

但是当我启动应用程序时,它会显示默认的Phonegap启动画面图像。 我检查了iOS项目'Images.xcassets' - >' LaunchImage ,它显示默认的PhoneGap图像。 它没有显示我在Config.xml文件中提到的splash image。 如何使用config.xml for iOS设置启动图像?


I am using PhoneGap for creating iOS application for iOS9+. As per guide line I have added following code in Config.xml to set the splash screen.

// set the cordova plugin 
 <plugin name="cordova-plugin-splashscreen" source="npm" spec="&gt;1.0.0" />

 // set splash screen for iPad only
 <platform name="ios">
    <gap:splash gap:platform="ios" height="2048" src="res/screen/ios/Default-Portrait@2x~ipad.png" width="1536" />
    <gap:splash gap:platform="ios" height="2048" src="res/screen/ios/Default-Portrait@2x~ipad.png" width="1536" />
    <gap:splash gap:platform="ios" height="768" src="res/screen/ios/Default-Landscape~ipad.png" width="1024" />
    <gap:splash gap:platform="ios" height="1536" src="res/screen/ios/Default-Landscape@2x~ipad.png" width="2048" />
</platform>

Then I used following command in 'Terminal' to generate iOS platform

phonegap build ios --device

It copies all the splash images in iOS platform.

But it show default Phonegap splash screens image when I launch the app. I checked in iOS project 'Images.xcassets'-> 'LaunchImage, it is showing default PhoneGap images. It is not showing splash Image which I mentioned in Config.xml file. How do I set the splash images using config.xml for iOS?


原文:https://stackoverflow.com/questions/40925159
更新时间:2023-07-08 20:07

最满意答案

维护一个变量来识别正在进行的ajax调用的订单号,例如。 1个用于第一次呼叫,2个用于第二个呼叫,3个用于ajax呼叫第3个字母。 每当ajax请求完成时,检查输入框值的当前字符串长度。 如果匹配,数据有效,将其写入您的页面,否则拒绝。

示例:完成值为3的ajax请求,输入框中的当前值=“hou”,因为hou.length == 3,它是正确的匹配,并且可以处理数据。


Maintain a variable to identify the order number of ajax call being made, eg. 1 for first call, 2 for second call,3 for ajax call for 3rd letter. And whenever the ajax request is complete, check current string length of the value of your input box. If they match, data is valid, write it in your page, else reject it.

example: ajax request with value 3 is completed, current value in input box = "hou" , since hou.length == 3 , it is a correct match, and data can be processed.

相关问答

更多
  • 您可以使用$.ajaxSetup()来订阅公共事件。 You could use the $.ajaxSetup() to subscribe for the common events.
  • 听起来你缺少的关键信息是$ .get的回调功能。 您可以将函数指定为请求完成时将触发的第二个或第三个参数 $.get('http://example.com/data', {'foo':'bar'}, function(resonseData){ //code here will be called when the ajax call has completed }) 因此,您需要在某个地方设置一个计数器变量,对于每个请求,它会增加一次,然后在回调中将该值减1。 然后,在你做出最终的get请求之 ...
  • 您可以在单击事件后禁用该按钮,然后在ajax请求success/error回调后启用它: $('#UniqueFormId').submit(function(event) { event.preventDefault(); var _this = $(this); _this.attr('disabled', 'disabled'); //disable the button // IN AJAX CALLBACK _this.removeA ...
  • 我会猜测getPage被调用两次。 将调试器语句放在函数的开头(调试器;)并打开firebug以查看它是否存在。 这是解决问题的一种方法,如果它被调用两次: //AJAX Navigation Helper function function getPage() { if(getPage.isLoaded != true) { //generate the parameter for the php script var data = 'page=' + e ...
  • 维护一个变量来识别正在进行的ajax调用的订单号,例如。 1个用于第一次呼叫,2个用于第二个呼叫,3个用于ajax呼叫第3个字母。 每当ajax请求完成时,检查输入框值的当前字符串长度。 如果匹配,数据有效,将其写入您的页面,否则拒绝。 示例:完成值为3的ajax请求,输入框中的当前值=“hou”,因为hou.length == 3,它是正确的匹配,并且可以处理数据。 Maintain a variable to identify the order number of ajax call being ma ...
  • 我用Google搜索“jQuery嵌套时”,并发现这个作为起点重新加入这个jsfiddle 。 我在上面实现的代码看起来很好,就像这个例子所示 - 第二个时候jquery调用/然后直到第一个set完成才被调用,这正是我认为我想要的依赖性。 这是javascript代码: function message(html) { $('
    ').html(html).appendTo($('body')); } function process(){ $.when(a1(), a2()) ...
  • async false是一种方法,因为如果条件为真,你希望使用x返回的值。 你也可以使用promises。 var x = 5; var ajaxCall; if(some condition) { ajaxCall = $.ajax({ url: "..."; }); } function usingx(x) { //Add your logic } if(typeof(ajaxCall) === 'undefined') { usingx(x); ...
  • 你已经在使用同步AJAX(对你的用户体验来说是个糟糕的主意),所以这不是问题所在。 问题是您需要在“提交”处理程序中取消默认操作: $(".submitForm").click(function(e){ var submittable = validatePrices(); e.preventDefault(); // this line if (submittable) { $("#myForm").submit(); } }); 对每个单独的字段使用同步HTTP请求 ...
  • 您可以创建一个全局变量: loadingAjax = false; 只要事件触发,您可以使用以下命令将此变量设置为TRUE: $("selector").click(function(){ if(!loadingAjax){ loadingAjax = true; $.ajax(options).. } }); 当ajax停止时你应该将loadingAjax变回false: $( document ).ajaxStop(function() { loadingAjax = ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。