Show/Hide TabBarController in iphone

后端 未结 4 602
别跟我提以往
别跟我提以往 2020-12-11 08:01

i am making an application in iphone in which i have 4 tabbars & in one of its tab i have 4 views in 2nd view it needs to hide the tab bar. I am able to hide the tab bar

相关标签:
4条回答
  • 2020-12-11 08:52

    Take a look at Apple's Elements projects. They hide and unhide the tab-bar when you view and individual element.

    0 讨论(0)
  • 2020-12-11 08:56

    I had the same issue to show or hide tab bar controller with UITableViewController customized class. Somehow, by using the following codes, does not work to hide tab bar controller:

    - (void) viewDidLoad {
         self.hidesBottomBarWhenPushed = YES;
    
    }
    

    In the case of storyboard with segue, initWithStyle: method does not get called.

    Instead, I have to overwrite the property to make it work:

    - (BOOL) hidesBottomBarWhenPushed {
      return YES;
    }
    

    My case is for iOS 5.1 with storyboard and segue to push to the next view (where I want to hide tab bar controller).

    0 讨论(0)
  • 2020-12-11 09:01

    John Smith is correct. The URL for that sample is: http://developer.apple.com/iphone/library/samplecode/TheElements/index.html

    The code that does this is in AtomicElementViewController.m, and the line that achieves this effect is in the init method:

        self.hidesBottomBarWhenPushed = YES;
    
    0 讨论(0)
  • 2020-12-11 09:05

    Before you push your 3rd view onto the stack, set the 2nd view's hidesBottomBarWhenPushed to NO.

    0 讨论(0)
提交回复
热议问题