先說一下遇到的問題,再present一個視圖時,隱藏底部的tabbar,回來的時候tabbar消失了
如果是push過去的話,這樣就可以了。
// 進入某個界面
NextViewController *nextVC = [[TypeSupplierViewController alloc] init];
// 根據點擊種類不同,設立種類屬性
nextVC.hidesBottomBarWhenPushed=YES;// 進入后隱藏tabbar
[self.navigationController pushViewController:nextVC animated:YES];
self.hidesBottomBarWhenPushed = NO;// 退出時顯示tabbar
但是present狀態下就不好使了,得這樣
AppDelegate *appdelegate=(AppDelegate*)[[UIApplication sharedApplication] delegate];
appdelegate.window.rootViewController.definesPresentationContext = YES;
[appdelegate.window.rootViewController presentViewController:presentedVC animated:YES completion:nil];
這樣的話回來的時候,tabbar就不會消失了