1. 程式人生 > >iOS 設定主介面隱藏navigationBar,跳轉後顯示出來

iOS 設定主介面隱藏navigationBar,跳轉後顯示出來

//利用生命週期設定是否隱藏 navigationBar

- (void)viewWillAppear:(BOOL)animated {

    [superviewWillAppear:animated];

    [self.navigationControllersetNavigationBarHidden:YESanimated:animated];

}

- (void)viewWillDisappear:(BOOL)animated {

    [superviewWillDisappear:animated];

    [self.navigationController

setNavigationBarHidden:NOanimated:animated];

}