浏览代码

iOS: Fix disappearing navigation bar on search

While searching, if the user change the orientation of the device, the navigation bar disappeared.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Soomin Lee 8 年之前
父节点
当前提交
821ea287b6
共有 1 个文件被更改,包括 12 次插入0 次删除
  1. 12 0
      Sources/VLCLibraryViewController.m

+ 12 - 0
Sources/VLCLibraryViewController.m

@@ -1738,6 +1738,18 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
     } completion:nil];
 }
 
+#pragma mark - UISearchBar Delegate
+
+- (void)searchBarTextDidEndEditing:(UISearchBar *)searchBar
+{
+    if (!self.usingTableViewToShowData) {
+        [self.collectionView.collectionViewLayout invalidateLayout];
+    }
+    [self.searchDisplayController setActive:NO];
+    [self enableNavigationBarAnimation:YES resetPositionWithAnimation:YES];
+    [self.navigationController setNavigationBarHidden:NO animated:NO];
+}
+
 #pragma mark - Search Display Controller Delegate
 
 - (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString