global ADBannerView in iPhone app

前端 未结 4 848
孤街浪徒
孤街浪徒 2020-12-28 22:03

Is it possible with a standard UINavigationController-rooted app, to have a single ADBannerView visible at the bottom of the screen, below the view hierarchy? That is, wit

4条回答
  •  [愿得一人]
    2020-12-28 22:25

    In my root view controller (w/ ADBannerViewDelegate) I setup my banner by adding it to the nav controller view, which keeps it on top at all times:

    banner = [[ADBannerView alloc] init];
    banner.delegate = self;
    banner.frame = CGRectMake(0.0, 430.0, banner.frame.size.width, banner.frame.size.height);
    [self.navigationController.view addSubview:banner];
    

    Note you will have to comment out layoutAnimated in delegate method bannerViewDidLoadAd as it will try to move the ad view up:

    - (void)bannerViewDidLoadAd:(ADBannerView *)banner
    {
        //[self layoutAnimated:YES];
    }
    

提交回复
热议问题