0
私はiAdにも、風景と肖像画の両方のモードでフィットしようとしていますが、風景モードでは届きません。ありがとう、ここに私のコード:iAdはiPadのラップスケープモードには適合しません
- (void)bannerViewDidLoadAd:(ADBannerView *)banner {
if (!self.bannerIsVisible) {
[UIView beginAnimations:@"animateOn" context:NULL];
adView.frame = CGRectOffset(adView.frame, 0, -adView.frame.size.height);
[UIView commitAnimations];
self.bannerIsVisible = YES;
}
}
- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error {
if (!self.bannerIsVisible) {
[UIView beginAnimations:@"animateOff" context:NULL];
adView.frame = CGRectOffset(adView.frame, 0, adView.frame.size.height);
[UIView commitAnimations];
self.bannerIsVisible = NO;
}
}
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)orientation duration:(NSTimeInterval)duration {
if (UIInterfaceOrientationIsPortrait(orientation)) {
adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
} else {
adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierLandscape;
}
}
- (void)viewDidLoad
{
self.bannerIsVisible = NO;
adView =[[ADBannerView alloc] initWithFrame:CGRectZero];
adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
adView.delegate = self;
[self.view addSubview:adView];
[super viewDidLoad];
}