浏览代码

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

* Fix topBar.title.component fill alignment

* Lock react-native-ui-lib version
Yogev Ben David 5 年前
父节点
当前提交
9f439dabd8
没有帐户链接到提交者的电子邮件
共有 4 个文件被更改,包括 5 次插入4 次删除
  1. 1
    1
      lib/ios/RNNReactView.h
  2. 2
    1
      lib/ios/RNNReactView.m
  3. 1
    1
      lib/ios/RNNViewControllerPresenter.m
  4. 1
    1
      package.json

+ 1
- 1
lib/ios/RNNReactView.h 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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",