浏览代码

[v2][iOS] Simplify searchBarHiddenWhenScrolling making its behaviour default to iOS one (#3611)

* Simplify searchBarHiddenWhenScrolling making its behaviour default to iOS one

* Update RNNTopBarOptions.m
Dima Loktev 7 年前
父节点
当前提交
3b732d0634
共有 2 个文件被更改,包括 2 次插入7 次删除
  1. 0
    5
      lib/ios/RNNRootViewController.m
  2. 2
    2
      lib/ios/RNNTopBarOptions.m

+ 0
- 5
lib/ios/RNNRootViewController.m 查看文件

65
 -(void)viewDidAppear:(BOOL)animated {
65
 -(void)viewDidAppear:(BOOL)animated {
66
 	[super viewDidAppear:animated];
66
 	[super viewDidAppear:animated];
67
 	[self.eventEmitter sendComponentDidAppear:self.componentId componentName:self.componentName];
67
 	[self.eventEmitter sendComponentDidAppear:self.componentId componentName:self.componentName];
68
-	if (@available(iOS 11.0, *)) {
69
-		if (self.navigationItem.searchController && [self.options.topBar.searchBarHiddenWhenScrolling boolValue]) {
70
-			self.navigationItem.hidesSearchBarWhenScrolling = YES;
71
-		}
72
-	}
73
 }
68
 }
74
 
69
 
75
 - (void)viewWillDisappear:(BOOL)animated {
70
 - (void)viewWillDisappear:(BOOL)animated {

+ 2
- 2
lib/ios/RNNTopBarOptions.m 查看文件

44
 				search.searchBar.placeholder = self.searchBarPlaceholder;
44
 				search.searchBar.placeholder = self.searchBarPlaceholder;
45
 			}
45
 			}
46
 			viewController.navigationItem.searchController = search;
46
 			viewController.navigationItem.searchController = search;
47
-			// enable it back if needed on componentDidAppear
48
-			viewController.navigationItem.hidesSearchBarWhenScrolling = NO;
47
+			
48
+			viewController.navigationItem.hidesSearchBarWhenScrolling = [self.searchBarHiddenWhenScrolling boolValue];
49
 			
49
 			
50
 			// Fixes #3450, otherwise, UIKit will infer the presentation context to be the root most view controller
50
 			// Fixes #3450, otherwise, UIKit will infer the presentation context to be the root most view controller
51
 			viewController.definesPresentationContext = YES;
51
 			viewController.definesPresentationContext = YES;