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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:51:28+00:00 2026-06-07T06:51:28+00:00

In my app from a login screen I am navigating to a class say

  • 0

In my app from a login screen I am navigating to a class say classA, like this:

classA *objUserHome = [[classA alloc]init];
        [self presentModalViewController:objUserHome animated:YES];
        [objUserHome release];

And ClassA is having a navigating bar and a tabbar (5 tabs in it), I have created my tab bar programmatically like this:

- (void)viewDidLoad
{
    [super viewDidLoad];
    //Create tab bar controller and navigation bar controller
    
    tabBarController = [[UITabBarController alloc] init];
    
    NSMutableArray *arrControllers = [[NSMutableArray alloc] initWithCapacity:5];
    
    //Add PunchClock to tab View Controller
    PunchClock* objPunchClock = [[PunchClock alloc] initWithTabBar];
    NavigationController = [[UINavigationController alloc] initWithRootViewController:objPunchClock];
    NavigationController.navigationBar.tintColor = [UIColor brownColor];
    [arrControllers addObject:NavigationController];
    [NavigationController release];
    [objPunchClock release];
    
    //Add Time_Sheet to tab View Controller
    Time_Sheet* objTime_Sheet = [[Time_Sheet alloc] initWithTabBar];
    NavigationController = [[UINavigationController alloc] initWithRootViewController:objTime_Sheet];
    NavigationController.navigationBar.tintColor = [UIColor brownColor];
    [arrControllers addObject:NavigationController];
    [NavigationController release];
    [objTime_Sheet release];
    
    //Add PTO to tab View Controller
    PTO* objPTO = [[PTO alloc] initWithTabBar];
    NavigationController = [[UINavigationController alloc] initWithRootViewController:objPTO];
    NavigationController.navigationBar.tintColor = [UIColor brownColor];
    [arrControllers addObject:NavigationController];
    [NavigationController release];
    [objPTO release];
    
    //Add PunchClock to tab View Controller
    CrewPunch* objCrewPunch = [[CrewPunch alloc] initWithTabBar];
    NavigationController = [[UINavigationController alloc] initWithRootViewController:objCrewPunch];
    NavigationController.navigationBar.tintColor = [UIColor brownColor];
    [arrControllers addObject:NavigationController];
    [NavigationController release];
    [objCrewPunch release];
    
    //Add PunchClock to tab View Controller
    Reports* objReports = [[Reports alloc] initWithTabBar];
    NavigationController = [[UINavigationController alloc] initWithRootViewController:objReports];
    NavigationController.navigationBar.tintColor = [UIColor brownColor];
    [arrControllers addObject:NavigationController];
    [NavigationController release];
    [objReports release];
    
    // Add this view controller array into the tab bar
    
    //self .viewControllers = arrControllers;
     tabBarController .viewControllers = arrControllers;
   
    [arrControllers release];
    [self.view addSubview:[tabBarController view]];
    
   
}

And ClassA is inherited from UIViewController

Now the problem is, after navigating to classA, view of classA is shifted some 4mm downwards per the image below. Why is it so? How can I fix this?

like this

  • 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-06-07T06:51:29+00:00Added an answer on June 7, 2026 at 6:51 am

    After a long research i finally fixed this issue just by inheriting the class from UINavigationController instead of UIViewControler

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

Sidebar

Related Questions

I wanna make a login screen like the one from Facebook's app. The part
I mean, the app has a login screen, but ONLY customers from a company
On the login screen of my app, after I get the credentials from the
In my app I have a login screen. When connecting a segue from the
My app is like a lot of apps -- it has a login screen
I'm trying to send a getJson call from my app (login form) to get
Am using django social-auth authentication for my app.After login to facebook or twitter from
My app was working great and then client asked to put a login screen
When user click on back button of android device from the login screen then
So, I'm building an iOS4 app that has a login screen and has to

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.