“Hide” the Tab Bar When Pushing a View

后端 未结 3 780
暗喜
暗喜 2021-01-13 02:20

The New York Times iPhone application has a Tab Bar with five tab bar items. When you select the Latest tab, the app shows the title and abstract/summary in a UITableView.

3条回答
  •  滥情空心
    2021-01-13 02:57

    I have a view that needs to optionally (depending on some other state) show the navigation controller toolbar. This is the solution I used to show & hide the toolbar (with animation) when the view appears & disappears via navigation. It sounds like what you might be after.

    - (void)viewWillAppear:(BOOL)animated
    {
        [super viewWillAppear:animated];
    
        // Show the nav controller toolbar if needed
        if (someBool)
            [self.navigationController setToolbarHidden:NO animated:animated];
    }
    
    - (void)viewWillDisappear:(BOOL)animated
    {
        [super viewWillDisappear:animated];
    
        // Hide the nav controller toolbar (if visible)
        [self.navigationController setToolbarHidden:YES animated:animated];
    }
    

提交回复
热议问题