首页 > iOS 从webview上present一个viewcontroller,然后再dismiss以后会触发哪个事件?

iOS 从webview上present一个viewcontroller,然后再dismiss以后会触发哪个事件?

iOS的web view上通过点击,触发presentModalViewController:animated:方法弹出一个新的view controller,然后这个新的view controller 调用dismissModalViewControllerAnimated:消失回到web view以后,哪个web上的事件会被触发?需要抓到这个返回的状态。
我在body上加了onfocus,没效果。
可能是没说清楚,有一个前提条件:不通过native代码调用


webview的viewController的viewWillappear吧


换个思路。
dismiss的时候通知webview所在的viewcontroller来执行一个js的function,来手动通知webview中的js执行某个方法。

NSString *jsCommand = [NSString stringWithString:@"alert('good luck')"];

[self.webView stringByEvaluatingJavaScriptFromString:jsCommand];
【热门文章】
【热门文章】