我使用的PhoneGap 2.3 - 克利弗於iOS。iOS中使用PhoneGap的利斧覆蓋方法
我如何可以覆蓋shouldStartLoadWithRequest,webViewDidStartLoad,webViewDidFinishLoad功能?
如果我添加「viewController.webView.delegate =自我」到viewDidLoad中,上述功能可以被調用,但不能調用的PhoneGap API。
謝謝。
MyViewController.m:
- (void)viewDidLoad
{
[super viewDidLoad];
CDVViewController* viewController = [CDVViewController new];
viewController.view.frame = self.view.bounds;
//viewController.webView.delegate = self;
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:landingURL]];
[viewController.webView loadRequest:request];
[self.view addSubview:viewController.view];
[self addChildViewController:viewController];
}
MyViewController.h:
@interface MyViewController : UIViewController <UIWebViewDelegate>
@end