我有一个有3个视图的viewController(+ adView)。 bannerViewDidLoadAd事件被正确触发,然后我想调整我的视图大小以使iAd可见。但是,视图不会调整大小,控制台会显示一条消息,告知iAd可能会被遮挡。如何把它带到前面并调整视图大小?谢谢。
- (void)bannerViewDidLoadAd:(ADBannerView *)banner {
if (!self.bannerIsVisible) { //&& iniciBanner
self.bannerIsVisible = YES;
[self.view addSubview:adView];
[UIView beginAnimations:@"animatedAdBannerOn" context:NULL];
//adView.frame = CGRectOffset(adView.frame, 0, adView.frame.size.height);
[UIView commitAnimations];
self.view.frame = CGRectMake(0, adView.frame.size.height, self.view.frame.size.width, self.view.frame.size.height - adView.frame.size.height);
self.vistaB.frame = CGRectMake(0, adView.frame.size.height, self.vistaB.frame.size.width, self.vistaB.frame.size.height - adView.frame.size.height);
self.vistaSocial.frame = CGRectMake(0, adView.frame.size.height, self.vistaSocial.frame.size.width, self.vistaSocial.frame.size.height - adView.frame.size.height);
[self.view bringSubviewToFront:adView];
}
}
答案 0 :(得分:0)
从您的代码中看起来一切正常,所以我最好的猜测是您忘记将视图的IBoutlet与Xib的UViews连接起来。