Browse Source

Fix for hidesSearchBarWhenScrolling

Signed-off-by: Philippe Weidmann <philippe.weidmann@infomaniak.com>
Philippe Weidmann 4 years ago
parent
commit
3c2b019a75
1 changed files with 4 additions and 2 deletions
  1. 4 2
      iOSClient/Main/CCMain.m

+ 4 - 2
iOSClient/Main/CCMain.m

@@ -215,6 +215,9 @@
 {
     [super viewWillAppear:animated];
     [self updateNavBarShadow:self.tableView force:false];
+    if (@available(iOS 13.0, *)) {
+        self.navigationItem.hidesSearchBarWhenScrolling = true;
+    }
     // test
     if (appDelegate.activeAccount.length == 0)
         return;
@@ -242,8 +245,6 @@
 - (void)viewDidAppear:(BOOL)animated
 {
     [super viewDidAppear:animated];
-    self.navigationItem.hidesSearchBarWhenScrolling = true;
-
     // Active Main
     appDelegate.activeMain = self;
     
@@ -306,6 +307,7 @@
 // detect scroll for remove keyboard in search mode
 - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
 {
+    self.navigationItem.hidesSearchBarWhenScrolling = true;
     if (self.searchController.isActive && scrollView == self.tableView) {
         
         [self.searchController.searchBar endEditing:YES];