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 6068129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:40:57+00:00 2026-05-23T09:40:57+00:00

Apple’s tab bar controller has a lot of limitations. One important limitation is that

  • 0

Apple’s tab bar controller has a lot of limitations. One important limitation is that you can’t modify the tab bar in a rejection safe mode. My tab bar has a simple sliding movements and it’s multi row.
For those reasons I decided to build a TBVC from the beginning; everything seems to work correctly, but I’m really messing around with rotation. Every time that I change orientation main view frames are changed.

Here is my hierarchy from top to the container view:
-MainView–contains–>TabBarView+containerView
The containerView is the view used to contain views loaded from the other controllers.
Here is the -loadView method of my CustomTabBaViewController

- (void)loadView
{
    UIView *theView=[[UIView alloc]initWithFrame:[[UIScreen mainScreen]bounds]];
    theView.autoresizingMask=UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
    theView.backgroundColor=[UIColor greenColor];

    containerOfControllersView=[[UIView alloc] initWithFrame:theView.bounds];
    containerOfControllersView.backgroundColor=[UIColor blueColor];
    containerOfControllersView.autoresizingMask=UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
    [theView addSubview:containerOfControllersView];

    ideoloTabBar=[[IdeoloTabBar alloc]initWithNumberOfControllers:[controllers count]];
    [theView addSubview:ideoloTabBar];
    self.view=theView;
    [theView release];
    
}

When I set a new view from another controller I use this method:

-(void)setCurrentViewWithView:(UIView*)theView{
    if ([[self.containerOfControllersView subviews] count]>0) {
        UIView *tagView=[self.containerOfControllersView viewWithTag:555];
        tagView.tag=0;
        [tagView removeFromSuperview];
    }
    theView.tag=555;
    theView.autoresizingMask=UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
    theView.frame=[[UIScreen mainScreen]applicationFrame];
    [self.containerOfControllersView addSubview:theView];
    [self.view bringSubviewToFront:ideoloTabBar];
}

As you can see the views from other view controllers are applied using the applicationFrame.

When I rotate the device happens something wrong, the mainview not only is resized according to the new orientation but also moved by 20px (status bar size) to the botton, thus leaving a gap between the status bar and the container view. Since I gave the mainview the screen bounds I can’t understand with it should be moved.

UPDATE

I’m trying a different approach so I’ve modified the loadView like that:

- (void)loadView
{
    [super loadView];
    containerOfControllersView=[[UIView alloc] initWithFrame:self.view.bounds];
    containerOfControllersView.backgroundColor=[UIColor blueColor];
    containerOfControllersView.autoresizingMask=UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
    self.view.backgroundColor=[UIColor greenColor];
    [self.view addSubview:containerOfControllersView];
    ideoloTabBar=[[IdeoloTabBar alloc]initWithNumberOfControllers:[controllers count]];
    [self.view addSubview:ideoloTabBar];
}

And in the setCurrentViewWithView:(UIView*)theView I’ve modified the line with

theView.frame=self.view.bounds;

instead of using the applicationFrame.

NOW:

On iPhone when I try to load a modalView it cuts about 40px at the bottom
On iPad when I try to load a modalView it lefts 20px at the bottom, because 20px are under the status bar but wantsFullScreen is NO.

UPDATE 2

It seems that the presentModalViewController should be called from the root view controller. I will create a protocol and an abstract UIViewController subclass to implement it an load it correctly.

Any suggestion? work around?

  • 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-23T09:40:57+00:00Added an answer on May 23, 2026 at 9:40 am

    It has been a while since I’m using my custom TabBarViewController with disappearing tabbar and it seems to work properly both on iPad and iPhone.
    The main problem that I had was due to an incorrect assignment to the content view frame and probably to a wrong assumption that modalVC were loaded from the current view controller.
    First point: the content view should use the bounds of the main view, here is a part of the loadView method of the Root View Controller:

    [super loadView];
    containerOfControllersView=[[UIView alloc] initWithFrame:self.view.bounds];
    

    Second:before add as a subview a view of a view controller remark to it that its frame should have the same bounds of its new parent view.

        theView.frame =self.view.bounds;
    

    Third: modal view controllers should be loaded from the root view controller or the will never have correct size. That’s why I’ve implemented a base abstract class for each view controllers that inherit a protocol that manage the presetation and dismissing of modal viewcontrollers.
    Hope this helps someone else.
    Andrea

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

Sidebar

Related Questions

Apple has many big colored buttons, that are not standard. One of them is
Apple developer document has the QTKit examples. I have noticed that it is only
Apple has explained in Launching the App Store from an iPhone application how one
Apple has extremely comprehensive documentation, but I can't find any documentation for the function
Apple wants me to give the user a friendly apology if I can't find
Apple has included HTTP Adaptive Bitrate Streaming in the iPhone OS 3.0, in particular
Apple clearly has this automated in some way, I would like to have access
Apple says I can register up to 100 devices to distribute an application. Is
Apple's documentation for UIDocumentInteractionController presentOpenInMenuFromBarButtonItem:animated: method states that If there are no registered apps
Apple has a nice little tutorial for making a simple master-detail interface. Interface Builder

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.