0

我有一个具有 3 个视图(+ adView)的 viewController。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];
    }   
}
4

1 回答 1

0

从您的代码看来一切正常,所以我最好的猜测是您忘记将视图的 IBoutlets 与 Xib 的 UViews 连接起来。

于 2012-06-05T12:22:36.583 回答