【发布时间】:2015-10-05 23:24:31
【问题描述】:
基本上,在 web 视图中,我的页面加载正常,但其中的 iframe 永远不会加载,它们只是保持白色或根本不出现,这在 htmlstrings 和 NSURL 会话中都会发生,请帮助。 代码
import Darwin
import UIKit
class ViewController: UIViewController {
@IBOutlet var InterfaceX: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
sleep(1)
let url=NSBundle.mainBundle().URLForResource("hi", withExtension: "html")
//let url = NSURL(string: "http://creepertech.net/xe/interface")
let request = NSURLRequest(URL: url!)
InterfaceX.loadRequest(request)
InterfaceX.allowsInlineMediaPlayback = true;
//let htm:String! = "<head><header></header></head><body><iframe src=\"http://xegaming.com\"></iframe></body>"
//InterfaceX.loadHTMLString(htm, baseURL: nil)
// Do any additional setup after loading the view, typically from a nib.
}
override func prefersStatusBarHidden() -> Bool {
return true
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
【问题讨论】: