Bladeren bron

fix #4625 (#5398)

* fix #4625

* fixed renamed property
Fabrizio Rizzonelli 5 jaren geleden
bovenliggende
commit
b434b4f82a
1 gewijzigde bestanden met toevoegingen van 15 en 2 verwijderingen
  1. 15
    2
      lib/ios/RNNViewControllerPresenter.m

+ 15
- 2
lib/ios/RNNViewControllerPresenter.m Bestand weergeven

@@ -156,6 +156,9 @@
156 156
 	
157 157
 	if (newOptions.topBar.title.component.name.hasValue) {
158 158
 		[self setCustomNavigationTitleView:newOptions perform:nil];
159
+	} else {
160
+		[_customTitleView removeFromSuperview];
161
+		_customTitleView = nil;
159 162
 	}
160 163
 	
161 164
 	if (newOptions.topBar.backButton.icon.hasValue || newOptions.topBar.backButton.showTitle.hasValue || newOptions.topBar.backButton.color.hasValue || newOptions.topBar.backButton.title.hasValue) {
@@ -191,10 +194,20 @@
191 194
 }
192 195
 
193 196
 - (void)setTitleViewWithSubtitle:(RNNNavigationOptions *)options {
194
-	if (!_customTitleView && options.topBar.subtitle.text.hasValue) {
197
+	if (!_customTitleView) {
195 198
 		_titleViewHelper = [[RNNTitleViewHelper alloc] initWithTitleViewOptions:options.topBar.title subTitleOptions:options.topBar.subtitle viewController:self.boundViewController];
199
+
200
+		if (options.topBar.title.text.hasValue) {
201
+			[_titleViewHelper setTitleOptions:options.topBar.title];
202
+		}
203
+		if (options.topBar.subtitle.text.hasValue) {
204
+			[_titleViewHelper setSubtitleOptions:options.topBar.subtitle];
205
+		}
206
+
196 207
 		[_titleViewHelper setup];
197
-	} else if (_titleViewHelper) {
208
+	} else {
209
+		_titleViewHelper = [[RNNTitleViewHelper alloc] initWithTitleViewOptions:options.topBar.title subTitleOptions:options.topBar.subtitle viewController:self.boundViewController];
210
+		
198 211
 		if (options.topBar.title.text.hasValue) {
199 212
 			[_titleViewHelper setTitleOptions:options.topBar.title];
200 213
 		}