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

  • Home
  • SEARCH
  • 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 6331665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:06:48+00:00 2026-05-24T18:06:48+00:00

I am having a problem with hiding the navigation bar in a tab bar

  • 0

I am having a problem with hiding the navigation bar in a tab bar controller. The initial tab hides correctly but any successive tabs will not hide their Nav bar. The other problem I am having is the same html file will not load in the other two tabs. This is really strange behavior as I have gotten html to load just fine in other applications.

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:    (NSDictionary *)launchOptions{
// Override point for customization after application launch.

        //create views
    testView *viewer1 = [[testView alloc] init];
    testView2 *viewer2 = [[testView2 alloc] init];
    testView3 *viewer3 = [[testView3 alloc] init];

    // Put viewers in a Nav controllers 
    UINavigationController *navCon1 = [[UINavigationController alloc] init];
    [navCon1 setViewControllers:[NSArray arrayWithObject:viewer1] animated:NO];
    UINavigationController *navCon2 = [[UINavigationController alloc] init];
    [navCon1 setViewControllers:[NSArray arrayWithObject:viewer2] animated:NO];
    UINavigationController *navCon3 = [[UINavigationController alloc] init];
    [navCon1 setViewControllers:[NSArray arrayWithObject:viewer3] animated:NO];

    // Put controllers in a tab bar
    UITabBarController *tabBar = [[UITabBarController alloc] init];
    tabBar.viewControllers = [NSArray arrayWithObjects:navCon1,navCon2,navCon3, nil];

    //Release all the stuff
    [viewer1 release]; [viewer2 release]; [viewer3 release];
    //[navCon1 release]; [navCon2 release]; [navCon3 release];

    [self.window addSubview:tabBar.view];

    [self.window makeKeyAndVisible];
    return YES;
}

// Test views are just a UIWebView as a sub view built in IB and then connected to the //IBOutlet and connected to be the delegate. 

//Here is TestView.m

    @implementation testView

    @synthesize webView;

    - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
    {
        self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
         if (self) {
        // Custom initialization
        self.navigationController.navigationBarHidden = YES;
    }
        return self;
    }

    - (void)didReceiveMemoryWarning
    {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];

    // Release any cached data, images, etc that aren't in use.
    }

    #pragma mark - View lifecycle

    - (void)viewDidLoad
    {
        [super viewDidLoad];

        // Do any additional setup after loading the view from its nib.
        NSString *path = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"           inDirectory:@"HTMLsupport"];
        NSURL *url = [NSURL fileURLWithPath:path];
        NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [webView loadRequest:request];
    }

    - (void)viewDidUnload
    {
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
    self.webView = nil;
    }

    - (BOOL)shouldAutorotateToInterfaceOrientation:  (UIInterfaceOrientation)interfaceOrientation
    {
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
    }

    @end

I have also tried to set the property in every delegate function using this new .m
Before I paste it this is the log print out

2011-08-14 04:23:23.857 startRipple2[1613:b303] viewDidLoad
[Switching to process 1613 thread 0xd603]
2011-08-14 04:23:23.859 startRipple2[1613:b303] viewWillAppear
2011-08-14 04:23:23.860 startRipple2[1613:b303] viewDidAppear
2011-08-14 04:23:23.860 startRipple2[1613:b303] its hidden
[Switching to process 1613 thread 0x12103]
2011-08-14 04:23:27.270 startRipple2[1613:b303] viewWillAppear
2011-08-14 04:23:27.271 startRipple2[1613:b303] viewDidAppear
2011-08-14 04:23:27.273 startRipple2[1613:b303] its hidden

BUT ITS STILL THERE! Something interesting to note is viewDidLoad is not called after clicking on the second tab.

    @synthesize webView;

    - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
    {
        self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
        if (self) {// Custom initialization

        [self.navigationController setNavigationBarHidden:YES animated:YES]; 
    }
    return self;
    }


    - (void)didReceiveMemoryWarning
    {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];

    // Release any cached data, images, etc that aren't in use.
    }

    #pragma mark - View lifecycle



    - (void)viewDidLoad
    {
    [super viewDidLoad];
    self.navigationController.navigationBarHidden = YES;
    NSString *path = [[NSBundle mainBundle] pathForResource:@"about" ofType:@"html" inDirectory:@"tabA"];
    NSURL *url = [NSURL fileURLWithPath:path];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [webView loadRequest:request];
    webView.scalesPageToFit = YES;
    // Do any additional setup after loading the view from its nib.
    NSLog(@"viewDidLoad");
    }
    - (void)viewWillAppear:(BOOL)animated{
    self.navigationController.navigationBarHidden = YES;
    NSLog(@"viewWillAppear");
    }

    - (void)viewDidAppear:(BOOL)animated{
     //self.navigationController.navigationBarHidden = YES;
    NSLog(@"viewDidAppear");
    if (self.navigationController.navigationBarHidden) {
        NSLog(@"its hidden");
    }

    if (!self.navigationController.navigationBarHidden){
        NSLog(@"its there...");
    }
    }

    - (IBAction)mySelector:(id)sender {
    NSLog(@"You touched me THERE!");
    [self.webView goBack];
    [self.navigationController setNavigationBarHidden:YES];
    }

    -(void)awakeFromNib{
    NSLog(@"awakeFromNib");
    [self.navigationController setNavigationBarHidden:YES];
    }

    - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request  navigationType:(UIWebViewNavigationType)navigationType{
    //int count =0;
    //count = count +1 ;
    //NSLog([NSString stringWithFormat:@"count %d",count]);

    return YES;
    }



    - (void)webViewDidFinishLoad:(UIWebView *)webView{
    /*if (navigationType == UIWebViewNavigationTypeLinkClicked || navigationType == UIWebViewNavigationTypeFormSubmitted) {
        [self.navigationController setNavigationBarHidden:NO];
        self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(mySelector:)];}*/
}

    - (void)viewDidUnload
    {
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
    self.webView = nil;
    }

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
    }

    @end
  • 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-24T18:06:49+00:00Added an answer on May 24, 2026 at 6:06 pm

    First theres an mistake in your code. In your applicationDidFinishLaunching you always set the viewcontrollers to navcon1 and not to navcon1, then navcon2, then navcon3.

    Fix this and check if the problem remains

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

Sidebar

Related Questions

I'm having an issue removing/hiding the status bar. I have looked at other posts
i'm having problem in hiding a text object in crystal report using ..... I
Hello I'm having the same problem from this post: Ajax.BeginForm not hiding loading element
Having problem with the middle Div not expanding to the width http://acs.graphicsmayhem.com/images/middiv.jpg Ok, how
We're having problem with a huge number of legacy stored procedures at work. Do
I'm having problem in the following line: rd.PrintOptions.PaperSize = PaperSize.PaperFanfoldStdGerman; it throws an exception
We are having problem with the server migration. We have one application that are
I'm having problem when running my Windows Forms program. In the program, I have
I'm having problem with Rails plugin attachment_fu . On every upload, I get validation
i'm having problem to deal with charset in ruby on rails app, specificially 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.