我正在使用Phonegap2.1。我的AppDelegate.m文件中有webViewDidFinishLoad方法。它曾經在以前的phonegap版本中被自己調用。現在,它根本不會被調用。我需要在某處分配委託嗎?phonegap - webViewDidFinishLoad沒有被調用
- (void)webViewDidFinishLoad:(UIWebView *)theWebView
{
if(self.invokeString)
{
// this is passed before the deviceready event is fired, so you can access it in js when you receive deviceready
NSString* jsString = [NSString stringWithFormat:@"var invokeString = \"%@\";", self.invokeString];
[theWebView stringByEvaluatingJavaScriptFromString:jsString];
}
// Black base color for background matches the native apps
theWebView.backgroundColor = [UIColor blackColor];
return [ self.viewController webViewDidFinishLoad:theWebView ];
}
請參閱答案 – iOSAndroidWindowsMobileAppsDev