如何在PhoneGap中为iOS设置启动画面(How to set splash screen for iOS in PhoneGap)
我正在使用
PhoneGap
为iOS9+
创建iOS
应用程序。 根据指南,我在Config.xml
添加了以下代码来设置启动画面。// set the cordova plugin <plugin name="cordova-plugin-splashscreen" source="npm" spec=">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
foriOS
设置启动图像?I am using
PhoneGap
for creatingiOS
application foriOS9+
. As per guide line I have added following code inConfig.xml
to set the splash screen.// set the cordova plugin <plugin name="cordova-plugin-splashscreen" source="npm" spec=">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 defaultPhoneGap
images. It is not showing splash Image which I mentioned in Config.xml file. How do I set the splash images usingconfig.xml
foriOS
?
原文:https://stackoverflow.com/questions/40925159
最满意答案
维护一个变量来识别正在进行的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.
相关问答
更多-
通过本地客户端程序获取服务器mysql数据库信息[2023-04-27]
ajax -
您可以使用$.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); ...
-
jQuery Ajax竞争条件?(jQuery Ajax Race Condition?)[2022-02-12]
你已经在使用同步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 = ...