BackBarButton not appearing in custom navigation bar. any fix?

Discussion in 'iOS Programming' started by hassoon, Feb 23, 2013.

  1. hassoon macrumors regular

    Joined:
    Jun 8, 2009
    #1
    hi, there is something that bugs me in Xcode. i'm creating an app which uses UiNavigationController however i don't want the navigation bar to appear in the initial window when the app is first loaded. i tried clicking on the Navigation Controller (the one before the root view controller) and in the inspector i chose "none" in the top bar drop down menu (in the attributes inspector). the navigation bar disappears. then i added a custom navigation bar from the library to the view that i actually want the bar to appearing, in order to go back (you can think of it ad the detailed view). however when i run the app the back button doesn't appear although i changed it's title from the inspector and the navigation bar with the title only appears. i feel like i'm changing the back button of the original navigation bar and not the new one. does anyone know how to solve this problem? is there a way to use a navigation bar in like second level or third level view of a navigation controller without letting it appear in the root view controller? thank you! P.S: if you want a visual explanation of my case just create a new project in Xcode with a master-detail template.
     
  2. iJustinCabral, Feb 23, 2013
    Last edited by a moderator: Feb 23, 2013

    iJustinCabral macrumors member

    iJustinCabral

    Joined:
    Jul 8, 2012
    #2
    Try have more white space between your questions next time. You make your intrigue hard to read, and confusing.

    Code:
    - (void)viewWillAppear: (BOOL)animated
    {
        [self.navigationController setNavigationBarHidden:YES animated:animated];
        [super viewWillAppear:animated];
    }
    
    - (void)viewWillDisappear: (BOOL)animated
    {
        [self.navigationController setNavigationBarHidden:NO animated:animated];
        [super viewWillDisappear:animated];
    }
    this should work
     
  3. hassoon, Feb 23, 2013
    Last edited by a moderator: Feb 23, 2013

    hassoon thread starter macrumors regular

    Joined:
    Jun 8, 2009
    #3
    Thank you so much, yes it did work! and sorry for making it difficult to read my post. have a nice day!
     

Share This Page