ソースを参照

Fix applying drawBehind through mergeOptions (#5951)

mergeOptions did not handle bottomTabs.drawBehind options properly - the ReactRootView wasn't remeasured.
Yogev Ben David 4 年 前
コミット
e002a68110
No account linked to committer's email address
共有2 個のファイルを変更した16 個の追加2 個の削除を含む
  1. 6
    2
      lib/ios/RNNComponentPresenter.m
  2. 10
    0
      lib/ios/UIViewController+RNNOptions.m

+ 6
- 2
lib/ios/RNNComponentPresenter.m ファイルの表示

@@ -118,9 +118,13 @@
118 118
 
119 119
 	if (options.topBar.drawBehind.hasValue) {
120 120
 		[viewController setDrawBehindTopBar:options.topBar.drawBehind.get];
121
-  }
121
+    }
122
+    
123
+    if (options.bottomTabs.drawBehind.hasValue) {
124
+        [viewController setDrawBehindTabBar:options.bottomTabs.drawBehind.get];
125
+    }
122 126
 
123
-  if (options.topBar.title.text.hasValue) {
127
+    if (options.topBar.title.text.hasValue) {
124 128
 		[viewController setNavigationItemTitle:options.topBar.title.text.get];
125 129
 	}
126 130
 

+ 10
- 0
lib/ios/UIViewController+RNNOptions.m ファイルの表示

@@ -62,6 +62,11 @@ const NSInteger BLUR_STATUS_TAG = 78264801;
62 62
 	} else {
63 63
 		self.edgesForExtendedLayout &= ~UIRectEdgeTop;
64 64
 	}
65
+    
66
+    if (self.isViewLoaded) {
67
+        [self.view setNeedsLayout];
68
+        [self.view layoutIfNeeded];
69
+    }
65 70
 }
66 71
 
67 72
 - (void)setDrawBehindTabBar:(BOOL)drawBehindTabBar {
@@ -70,6 +75,11 @@ const NSInteger BLUR_STATUS_TAG = 78264801;
70 75
 	} else {
71 76
 		self.edgesForExtendedLayout &= ~UIRectEdgeBottom;
72 77
 	}
78
+    
79
+    if (self.isViewLoaded) {
80
+        [self.view setNeedsLayout];
81
+        [self.view layoutIfNeeded];
82
+    }
73 83
 }
74 84
 
75 85
 - (void)setTabBarItemBadge:(NSString *)badge {