我認爲它與由TabBarController提供的「更多」控制器有自己的導航控制器有關,而且您的故事板設置爲將邊緣延伸到頂部條之外。
儘管您試圖隱藏導航欄,但我認爲它在錯誤的位置完成,並且只應在項目在「更多」控制器中呈現時才需要。它目前實施的方式混淆了頂部佈局指南,這似乎是假設有兩個頂部酒吧,即使其中一個隱藏。
我能夠通過兩種方式解決您的演示項目。由任一:
1)更新故事板並關閉「延伸邊緣」的標籤條上(並設置選項卡欄和頂部條是不透明的):
![enter image description here](https://i.stack.imgur.com/SYbdF.png)
OR
2)簡化viewWillAppear中/消失和viewDidAppear /消失的方法和標籤欄內時隱藏導航欄多個控制器:
- (void)viewDidAppear:(BOOL)animated{
//self.navigationItem.backBarButtonItem.title = @"HOME";
self.tabBarController.title = @"Entity List";
//Pretty activity indicator
[self.topTableView reloadData];
}
- (void)viewWillAppear:(BOOL)animated {
if (self.navigationController == self.tabBarController.moreNavigationController) {
[self.tabBarController.navigationController setNavigationBarHidden:YES];
} else {
[self.navigationController setNavigationBarHidden:NO];
}
}
- (void)viewWillDisappear:(BOOL)animated {
[self.navigationController.navigationBar setHidden:NO];
}
- (void)viewDidDisappear:(BOOL)animated {
}
這確保頂部導航正確顯示,而不會弄亂佈局指南。
爲什麼downvote然後upvote?這是答案不可理解? – NSDeveloper
刪除頂部版式指南並在示例應用程序中以及在我的大型客戶端應用程序中使用該引腳都有問題。感謝您分享這個鏈接 - 解決問題的方法不是我自己想要的。 – propstm