我目前正在構建一個應用程序,彈出包含WkWebView的模式視圖。當我想要在此模式視圖中上傳圖像並且出現照片選擇時,模式視圖會退回到啓動它的視圖控制器。在WkWebView中選擇圖像時模態視圖關閉iOS
我該如何預防?
import UIKit
class PostWindow : UIViewController {
@IBAction func close(sender: AnyObject) {
dismissViewControllerAnimated(true, completion: nil)
}
override func viewDidLoad() {
super.viewDidLoad()
// do stuff here
let myWebView:UIWebView = UIWebView(frame: CGRectMake(0, 70, UIScreen.mainScreen().bounds.width, UIScreen.mainScreen().bounds.height))
myWebView.loadRequest(NSURLRequest(URL: NSURL(string: "https://m.facebook.com/")!))
self.view.addSubview(myWebView)
self.title = "News Feed"
UIApplication.sharedApplication().setStatusBarStyle(UIStatusBarStyle.Default, animated: true)
UIApplication.sharedApplication().statusBarHidden = false
/*let addButton: UIBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Search,
target: self,
action: #selector(self.openSearch(_:)))
self.navigationItem.setRightBarButtonItems([addButton], animated: true)*/
self.navigationController?.navigationBar.tintColor = UIColor.blackColor()
}
override func preferredStatusBarStyle() -> UIStatusBarStyle {
return UIStatusBarStyle.LightContent
}
}
謝謝!