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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:42:28+00:00 2026-05-16T18:42:28+00:00

I am creating a UIView programatically in loadView . The application has a UITabBarController

  • 0

I am creating a UIView programatically in loadView. The application has a UITabBarController and UINavigationController.

How do I create a view that automatically resizes when a tab bar and a navigation bar both exist?

My current approach to this problem is calculating the heights of the navigation and tab bar controllers and subtracting them from the mainScreen’s height:

float navObjectsHeight = self.tabBarController.tabBar.frame.size.height 
    + self.navigationController.navigationBar.frame.size.height;

CGRect mainFrame = CGRectMake(0, 0, screenFrame.size.width, 
  screenFrame.size.height - navObjectsHeight);

UIView *contentWrapper = [[UIView alloc] initWithFrame:mainFrame];
  • 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-16T18:42:28+00:00Added an answer on May 16, 2026 at 6:42 pm

    The UIView has a property to handle that situation. As you are creating it programatically the code to use is:

    UIView *aView = [[UIView alloc] init];
    aView.autoresizingMask = UIViewAutoresizingFlexibleHeight;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm programatically creating a custom section header for a table that has a width
I have a view that I'm creating in the loadview like this: - (void)loadView
Creating a view with following code. - (void)loadView { paintView=[[UIView alloc]initWithFrame:CGRectMake(0, 50, 320, 430)];
I'm creating a new class that inherits from UIView. I remember that xcode 3
I am trying to create a custom UIView that is stored in a nib
I am creating a UIView containing some text that partially covers a UIImageView. I
I'm having trouble creating a UIView (in Interface Builder) that contains a UITableView with
I am bit stack with creating two UIViews which are switchable (each UIView has
When creating a UIView with a navigation bar in interface builder, the top bar
I'm working on creating a UIView subclass (which I'm calling MarqueeLabel ) that animates

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.