简体   繁体   English

Xcode7-模拟器中的WebView应用黑屏

[英]Xcode7 - WebView app black screen in simulator

I'm kinda new to xcode and I'm trying to make a webView app. 我是xcode的新手,我正在尝试制作一个webView应用程序。 In Android Studio I'm done in 10 minutes, but I've been struggling with a iOS one for a few days now. 在Android Studio中,我只用了10分钟就完成了工作,但是几天来我一直在为iOS操作系统而苦苦挣扎。 On build the app is not showing any errors or bugs, and the simulator works just fine. 在构建时,该应用程序未显示任何错误或错误,并且模拟器运行正常。 But when it tries to start my app, the screen turns black, but I'm still able to navigate just fine on the simulator phone so I think the app is the problem? 但是,当它尝试启动我的应用程序时,屏幕变黑,但是我仍然能够在模拟器手机上正常浏览,所以我认为应用程序有问题吗?

I have followed two different tutorials for making a webview app, but they both give the same result as mentioned before: 我遵循了两个不同的教程来制作Webview应用程序,但是它们都给出了与前面提到的相同的结果:

Tutorial 1: iOS Tutorial – Creating a Web View (UIWebView) 教程1: iOS教程–创建Web视图(UIWebView)
Tutorial 2: How To Make an App For Your Website In Less Than 30 Minutes 教程2: 如何在不到30分钟的时间内为您的网站制作应用
Xcode version: 7 Xcode版本: 7
Deployment target: 8.4 部署目标: 8.4
Simulator tested : iPhone 6s plus/iPhone 6s/iPhone 4s 经过模拟器测试 :iPhone 6s plus / iPhone 6s / iPhone 4s

Just followed another tutorial , and it seems to be working fine for apple.com, but not for the website that I want to use it for: http://macrofoods.nl The app seems to be stuck at a white screen. 只是紧跟着另一个教程 ,它似乎对apple.com来说运行良好,但是对于我要用于它的网站却不起作用: http : //macrofoods.nl该应用程序似乎卡在了白色屏幕上。

Ok, so I've figured it out. 好的,所以我知道了。 The last tutoriali posted works fine. 最后发布的tutoriali效果很好。 Xcode/the app was blocking the website because it's not a https:// website, but a http:// website. Xcode /该应用阻止了该网站,因为它不是一个https://网站,而是一个http://网站。 To work around this, i stumbled on this question: How do I load an HTTP URL with App Transport Security enabled in iOS 9? 要变通解决此问题,我偶然遇到了一个问题: 如何在iOS 9中启用了应用传输安全性的情况下加载HTTP URL?

And i got my app working. 而且我让我的应用程序正常工作。

are you trying to build a cross platform app ..? 您是否正在尝试构建跨平台应用程序..? you can make hybrid apps with cordova/phonegap.it's running on a web interface. 您可以使用在网络界面上运行的cordova / phonegap制作混合应用程序。

Check this 检查一下

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM