这是一个Phonegap 应用程序。我在这里完全迷路了,请帮忙。我按照本教程进行了操作。
这是我的 MainViewController.m:
- (void)webViewDidFinishLoad:(UIWebView*)theWebView
{
adView = [[ADBannerView alloc] initWithFrame:CGRectZero];
if([UIApplication sharedApplication].statusBarOrientation ==
UIInterfaceOrientationPortrait ||
[UIApplication sharedApplication].statusBarOrientation ==
UIInterfaceOrientationPortraitUpsideDown) {
adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
}
else {
adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierLandscape;
}
adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
CGRect adFrame = adView.frame;
adFrame.origin.y = self.view.frame.size.height-adView.frame.size.height;
adView.frame = adFrame;
[self.view addSubview:adView];
// Black base color for background matches the native apps
theWebView.backgroundColor = [UIColor blackColor];
return [super webViewDidFinishLoad:theWebView];
}