導航欄不顯示在表格視圖的結尾處。我究竟做錯了什麼?在表格視圖結尾處顯示導航欄
- (void)tableView:(UITableView *)tableView didEndDisplayingCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
if([indexPath row] == [tableView numberOfRowsInSection: 0] - 1){
[self.navigationController setNavigationBarHidden:NO
animated:YES];
DDLogVerbose(@"Reached end of tableview");
}
}
「到達結束tableview」輸出到Xcode,但導航欄(以前隱藏),不會重新出現。
我也嘗試過使用willDisplayCell
,但顯示導航欄太早,就在最後一個單元在屏幕上之前,這並不理想。
爲什麼即使輸入了if語句,導航欄也不會重新出現在tableview的末尾?我該怎麼做才能讓它重新出現?
更新:偉大的答案大家,雖然我也很感激,如果有人可以可能向我解釋,爲什麼上面的代碼無法正常工作。謝謝!
在我結束didEndDisplayingCell不打電話,因爲我有6.0 – Warewolf