[英]iOS subviews are not resized when iAD appears
I have a viewController that has 3 views (+ adView). 我有一个viewController具有3个视图(+ adView)。 bannerViewDidLoadAd event is triggered properly and then I would like to resize my views in order to make iAd visible.
bannerViewDidLoadAd事件已正确触发,然后我想调整视图大小以使iAd可见。 However, views are not resized and console shows a message telling that iAd may be obscured.
但是,视图不会调整大小,控制台会显示一条消息,提示iAd可能被遮盖。 How to bring it then to front and resize views?
然后如何将其放到前面并调整视图大小? Thank you.
谢谢。
- (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];
}
}
从您的代码来看,一切似乎都还可以,所以我最好的猜测是您忘记了将视图的IBoutlet与Xib的UView连接起来。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.