|
@@ -139,16 +139,20 @@
|
139
|
139
|
if (!_customTitleView) {
|
140
|
140
|
if (self.options.topBar.title.component.name) {
|
141
|
141
|
_customTitleView = (RNNReactRootView*)[_creator createRootViewFromComponentOptions:self.options.topBar.title.component];
|
142
|
|
- _customTitleView.backgroundColor = UIColor.clearColor;
|
|
142
|
+ _customTitleView.backgroundColor = UIColor.redColor;
|
143
|
143
|
[_customTitleView setAlignment:self.options.topBar.title.component.alignment];
|
144
|
144
|
BOOL isCenter = [self.options.topBar.title.component.alignment isEqualToString:@"center"];
|
145
|
145
|
__weak RNNReactRootView *weakTitleView = _customTitleView;
|
|
146
|
+ CGRect frame = self.navigationController.navigationBar.frame;
|
|
147
|
+ [_customTitleView setFrame:frame];
|
146
|
148
|
[_customTitleView setRootViewDidChangeIntrinsicSize:^(CGSize intrinsicContentSize) {
|
147
|
149
|
if (isCenter) {
|
148
|
150
|
[weakTitleView setFrame:CGRectMake(0, 0, intrinsicContentSize.width, intrinsicContentSize.height)];
|
|
151
|
+ } else {
|
|
152
|
+ [weakTitleView setFrame:frame];
|
149
|
153
|
}
|
150
|
154
|
}];
|
151
|
|
- [_customTitleView setFrame:self.navigationController.navigationBar.frame];
|
|
155
|
+
|
152
|
156
|
self.navigationItem.titleView = _customTitleView;
|
153
|
157
|
}
|
154
|
158
|
} else if (_customTitleView && _customTitleView.superview == nil) {
|