Procházet zdrojové kódy

Fix topBar.title.component fill alignment (#5044)

* Fix topBar.title.component fill alignment

* Lock react-native-ui-lib version
Yogev Ben David před 5 roky
rodič
revize
9f439dabd8
No account linked to committer's email address

+ 1
- 1
lib/ios/RNNReactView.h Zobrazit soubor

@@ -10,6 +10,6 @@ typedef void (^RNNReactViewReadyCompletionBlock)(void);
10 10
 @property (nonatomic, copy) void (^rootViewDidChangeIntrinsicSize)(CGSize intrinsicSize);
11 11
 @property (nonatomic, copy) RNNReactViewReadyCompletionBlock reactViewReadyBlock;
12 12
 
13
-- (void)setAlignment:(NSString *)alignment;
13
+- (void)setAlignment:(NSString *)alignment inFrame:(CGRect)frame;
14 14
 
15 15
 @end

+ 2
- 1
lib/ios/RNNReactView.m Zobrazit soubor

@@ -40,9 +40,10 @@
40 40
 	}
41 41
 }
42 42
 
43
-- (void)setAlignment:(NSString *)alignment {
43
+- (void)setAlignment:(NSString *)alignment inFrame:(CGRect)frame {
44 44
 	if ([alignment isEqualToString:@"fill"]) {
45 45
 		self.sizeFlexibility = RCTRootViewSizeFlexibilityNone;
46
+		[self setFrame:frame];
46 47
 	} else {
47 48
 		self.sizeFlexibility = RCTRootViewSizeFlexibilityWidthAndHeight;
48 49
 		__weak RNNReactView *weakSelf = self;

+ 1
- 1
lib/ios/RNNViewControllerPresenter.m Zobrazit soubor

@@ -167,7 +167,7 @@
167 167
 		_customTitleView = (RNNReactView*)[_componentRegistry createComponentIfNotExists:options.topBar.title.component parentComponentId:viewController.layoutInfo.componentId reactViewReadyBlock:readyBlock];
168 168
 		_customTitleView.backgroundColor = UIColor.clearColor;
169 169
 		NSString* alignment = [options.topBar.title.component.alignment getWithDefaultValue:@""];
170
-		[_customTitleView setAlignment:alignment];
170
+		[_customTitleView setAlignment:alignment inFrame:viewController.navigationController.navigationBar.frame];
171 171
 
172 172
 		viewController.navigationItem.titleView = nil;
173 173
 		viewController.navigationItem.titleView = _customTitleView;

+ 1
- 1
package.json Zobrazit soubor

@@ -61,7 +61,7 @@
61 61
     "@types/react-test-renderer": "16.x.x",
62 62
     "jsc-android": "236355.x.x",
63 63
     "detox": "12.1.x",
64
-    "react-native-ui-lib": "3.x.x",
64
+    "react-native-ui-lib": "3.24.2",
65 65
     "handlebars": "4.x.x",
66 66
     "jest": "23.x.x",
67 67
     "metro-react-native-babel-preset": "0.50.0",