Browse Source

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

* Fix topBar.title.component fill alignment

* Lock react-native-ui-lib version
Yogev Ben David 5 years ago
parent
commit
9f439dabd8
No account linked to committer's email address
4 changed files with 5 additions and 4 deletions
  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 View File

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

+ 2
- 1
lib/ios/RNNReactView.m View File

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

+ 1
- 1
lib/ios/RNNViewControllerPresenter.m View File

167
 		_customTitleView = (RNNReactView*)[_componentRegistry createComponentIfNotExists:options.topBar.title.component parentComponentId:viewController.layoutInfo.componentId reactViewReadyBlock:readyBlock];
167
 		_customTitleView = (RNNReactView*)[_componentRegistry createComponentIfNotExists:options.topBar.title.component parentComponentId:viewController.layoutInfo.componentId reactViewReadyBlock:readyBlock];
168
 		_customTitleView.backgroundColor = UIColor.clearColor;
168
 		_customTitleView.backgroundColor = UIColor.clearColor;
169
 		NSString* alignment = [options.topBar.title.component.alignment getWithDefaultValue:@""];
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
 		viewController.navigationItem.titleView = nil;
172
 		viewController.navigationItem.titleView = nil;
173
 		viewController.navigationItem.titleView = _customTitleView;
173
 		viewController.navigationItem.titleView = _customTitleView;

+ 1
- 1
package.json View File

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