|
@@ -166,22 +166,9 @@
|
166
|
166
|
if (options.topBar.title.component.name.hasValue) {
|
167
|
167
|
_customTitleView = (RNNReactView*)[_componentRegistry createComponentIfNotExists:options.topBar.title.component parentComponentId:viewController.layoutInfo.componentId reactViewReadyBlock:readyBlock];
|
168
|
168
|
_customTitleView.backgroundColor = UIColor.clearColor;
|
169
|
|
-
|
170
|
169
|
NSString* alignment = [options.topBar.title.component.alignment getWithDefaultValue:@""];
|
171
|
170
|
[_customTitleView setAlignment:alignment];
|
172
|
|
-
|
173
|
|
- BOOL isCenter = [alignment isEqualToString:@"center"];
|
174
|
|
- __weak RNNReactView *weakTitleView = _customTitleView;
|
175
|
|
- CGRect frame = viewController.navigationController.navigationBar.bounds;
|
176
|
|
- [_customTitleView setFrame:frame];
|
177
|
|
- [_customTitleView setRootViewDidChangeIntrinsicSize:^(CGSize intrinsicContentSize) {
|
178
|
|
- if (isCenter) {
|
179
|
|
- [weakTitleView setFrame:CGRectMake(0, 0, intrinsicContentSize.width, intrinsicContentSize.height)];
|
180
|
|
- } else {
|
181
|
|
- [weakTitleView setFrame:frame];
|
182
|
|
- }
|
183
|
|
- }];
|
184
|
|
-
|
|
171
|
+
|
185
|
172
|
viewController.navigationItem.titleView = _customTitleView;
|
186
|
173
|
} else {
|
187
|
174
|
[_customTitleView removeFromSuperview];
|