Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1079775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:55:22+00:00 2026-05-16T21:55:22+00:00

Is it possible with a standard UINavigationController-rooted app, to have a single ADBannerView visible

  • 0

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, without modifying each view-controller/view that can be pushed to the root UINavigationController, can I have a global ADBannerView be visible?

I’m not sure how to set this up, either in IB or in code. Help?

I see similar questions with vague answers. I’m looking for a concrete example.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T21:55:22+00:00Added an answer on May 16, 2026 at 9:55 pm

    EDIT: The better way to do this in iOS5+ is likely to use view controller containment. That is, make a root controller that contains your ad and application controller (nav, tab, etc.).

    I figured out a way to do this. Here is what I did:

    For my first attempt I created a new view controller called AdBannerController. For its view I created a full-screen view and two subviews. The first subview (contentView) is for regular content, the second is the AdBannerView. I used an instance of this view controller as the view controller associated with the app window ( [window addSubview: adBannerController.view] ). Then I added my UINavigationController.view as a subview of adBannerController.view: [adBannerController.contentView addSubview: navigationController.view].

    This mostly worked except that viewcontrollers pushed to the UINavigationController never got their will/did-load/unload methods called. Shucks. I read in a few places that this is a symptom of the UINavigationController view not being a direct descendant of the app window.

    For my second attempt I took the same AdBannerController and derived it from UINavigationController. This time, I did the following in loadView:

    - (void)loadView
    {
        [super loadView];
    
        _contentView = [self.view retain];
    
        self.view = [[[UIView alloc] initWithFrame: _contentView.frame] autorelease];
    
        [self.view addSubview: _contentView];
    
        _adView = [[ADBannerView alloc] initWithFrame: CGRectMake(0, _contentView.bounds.size.height, 320, 50)];
        _adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifier320x50;
        _adView.delegate = self;
    
        [self.view addSubview: _adView]; 
    
        /* for visual debugging of view layout
        [[_mainView layer] setCornerRadius: 6.0];
        [[_mainView layer] setMasksToBounds: YES];
        [[_mainView layer] setBorderWidth: 1.5];
        [[_mainView layer] setBorderColor: [[UIColor grayColor] CGColor]];  
         */
    }
    

    Notice what happens – I let the superclass UINavigationController construct its regular “content” view, but I swap it out and replace it with my own view which is a container for both the content and ad views.

    This works pretty well. I’m also using three20 and there were a few things required to make this work with that setup, but not too bad.

    I hope this helps someone!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an iPhone app which uses a standard implementation of UINavigationController for the
Is it possible to have standard war deployment, which can be deployed on tomcat
Possible Duplicate: Is there a standard date/time format that can be passed on a
Is it possible to override the standard layouts that are provided with Android? Is
Possible Duplicate: LINQ to SQL: Return anonymous type? I have a standard LINQ to
Is it possible using a standard unordered list with a fixed height, to have
The C standard guarantees that an int is able to store every possible array
Possible Duplicate: Standard Android Button with a different color I have 1 problem -
Possible Duplicate: Standard data structure library in C? Does C have any data structure
Possible Duplicate: Standard way to remove multiple elements from a dataframe I know in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.