فهرست منبع

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