yogevbd 6 years ago
parent
commit
60e0b3957d
2 changed files with 24 additions and 4 deletions
  1. 5
    4
      ios/RCCNavigationController.m
  2. 19
    0
      ios/RCCViewController.m

+ 5
- 4
ios/RCCNavigationController.m View File

@@ -128,13 +128,14 @@ NSString const *CALLBACK_ASSOCIATED_ID = @"RCCNavigationController.CALLBACK_ASSO
128 128
       }
129 129
     }
130 130
     
131
+    NSMutableDictionary *mergedStyle = [NSMutableDictionary dictionaryWithDictionary:navigatorStyle];
132
+    [mergedStyle setValuesForKeysWithDictionary:actionParams];
133
+    
134
+    navigatorStyle = mergedStyle;
135
+    
131 136
     RCCViewController *viewController = [[RCCViewController alloc] initWithComponent:component passProps:passProps navigatorStyle:navigatorStyle globalProps:nil bridge:bridge];
132 137
     viewController.controllerId = passProps[@"screenInstanceID"];
133 138
     
134
-    [self processTitleView:viewController
135
-                     props:actionParams
136
-                     style:navigatorStyle];
137
-    
138 139
     NSString *backButtonTitle = actionParams[@"backButtonTitle"];
139 140
     if (!backButtonTitle) {
140 141
       NSNumber *hideBackButtonTitle = [[RCCManager sharedInstance] getAppStyle][@"hideBackButtonTitle"];

+ 19
- 0
ios/RCCViewController.m View File

@@ -650,6 +650,10 @@ const NSInteger TRANSPARENT_NAVBAR_TAG = 78264803;
650 650
       self.navigationItem.titleView.clipsToBounds = YES;
651 651
     }
652 652
   }
653
+    
654
+    [self processTitleView:viewController
655
+                     props:self.navigatorStyle
656
+                     style:self.navigatorStyle];
653 657
 
654 658
   #if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_10_3
655 659
   if (@available(iOS 11.0, *)) {
@@ -672,6 +676,21 @@ const NSInteger TRANSPARENT_NAVBAR_TAG = 78264803;
672 676
   #endif
673 677
 }
674 678
 
679
+-(void)processTitleView:(UIViewController*)viewController
680
+                  props:(NSDictionary*)props
681
+                  style:(NSDictionary*)style {
682
+    BOOL isSetSubtitleBool = props[@"isSetSubtitle"] ? [props[@"isSetSubtitle"] boolValue] : NO;
683
+    RCCTitleViewHelper *titleViewHelper = [[RCCTitleViewHelper alloc] init:viewController
684
+                                                      navigationController:self.navigationController
685
+                                                                     title:props[@"title"]
686
+                                                                  subtitle:props[@"subtitle"]
687
+                                                            titleImageData:props[@"titleImage"]
688
+                                                             isSetSubtitle:isSetSubtitleBool];
689
+    
690
+    [titleViewHelper setup:style];
691
+    
692
+}
693
+
675 694
 - (void) viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
676 695
   [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
677 696
   RCCCustomTitleView* customNavBar = (RCCCustomTitleView*) self.navigationItem.titleView;