ios – 即使在加载网址后,UIWebview仍显示空白屏幕

ios – 即使在加载网址后,UIWebview仍显示空白屏幕,第1张

概述我有一个html页面,在提交按钮上单击我需要调用支付网关URL. 我正在使用NSMutableURLRequest并传递帖子数据,我正在调用URL 请找到以下代码: NSDictionary *parameters = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:currency_code,apikey,merchan 我有一个HTML页面,在提交按钮上单击我需要调用支付网关URL.
我正在使用NSMutableURLRequest并传递帖子数据,我正在调用URL
请找到以下代码:

NSDictionary *parameters = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:currency_code,APIkey,merchant_ID,checksum_method,authorize_user,ip_address,hash,NB,nil] forKeys:[NSArray arrayWithObjects:@"currency_code",@"APIkey",@"merchant_ID",@"checksum_method",@"authorize_user",@"ip_address",@"checksum",@"cardType",nil]];__block Nsstring *post = @"";[parameters enumerateKeysAndobjectsUsingBlock:^(ID key,ID obj,BOol *stop) {    if ([post isEqualToString:@""]) {        post = [Nsstring stringWithFormat:@"%@=%@",key,obj];    } else {        post = [Nsstring stringWithFormat:@"%@&%@=%@",post,obj];    }}];NSData *postData = [post dataUsingEnCoding:NSUTF8StringEnCoding allowLossyConversion:YES];Nsstring *postLength = [Nsstring stringWithFormat:@"%ld",[postData length]];NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];[request setURL:[NSURL URLWithString:@"http://pay.sandBox.shmart.in/pay_merchant/Js"]];[request sethttpMethod:@"POST"];[request setValue:postLength forhttpheaderFIEld:@"Content-Length"];[request setValue:@"application/x-www-form-urlencoded" forhttpheaderFIEld:@"Content-Type"];[request sethttpBody:postData];[webvIEw loadRequest:request];

webVIEwDIDFinishLoad也被调用,但它显示我一个空白的白色屏幕.
什么是问题的任何想法.

解决方法 传输安全性已阻止明文http(http://)资源加载,因为它不安全,您需要添加您必须在your.pList文件中设置NSAllowsArbitraryLoadskey至YESESNSAppTransportSecuritydictionary.并尝试查看此 link 总结

以上是内存溢出为你收集整理的ios – 即使在加载网址后,UIWebview仍显示空白屏幕全部内容,希望文章能够帮你解决ios – 即使在加载网址后,UIWebview仍显示空白屏幕所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1049952.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-25
下一篇 2022-05-25

发表评论

登录后才能评论

评论列表(0条)

保存