|
@@ -16,7 +16,7 @@
|
16
|
16
|
[self setTitleAttributes:options.title];
|
17
|
17
|
[self setLargeTitleAttributes:options.largeTitle];
|
18
|
18
|
[self showBorder:![options.noBorder getWithDefaultValue:NO]];
|
19
|
|
- [self setBackButtonIcon:[options.backButton.icon getWithDefaultValue:nil] withColor:[options.backButton.color getWithDefaultValue:nil] title:[options.backButton.title getWithDefaultValue:nil] showTitle:[options.backButton.showTitle getWithDefaultValue:YES]];
|
|
19
|
+ [self setBackButtonOptions:[options.backButton.icon getWithDefaultValue:nil] withColor:[options.backButton.color getWithDefaultValue:nil] title:[options.backButton.title getWithDefaultValue:nil] showTitle:[options.backButton.showTitle getWithDefaultValue:YES] fontFamily:[options.backButton.fontFamily getWithDefaultValue:nil] fontSize:[options.backButton.fontSize getWithDefaultValue:nil]];
|
20
|
20
|
}
|
21
|
21
|
|
22
|
22
|
- (void)applyOptionsBeforePopping:(RNNTopBarOptions *)options {
|
|
@@ -48,7 +48,7 @@
|
48
|
48
|
}
|
49
|
49
|
|
50
|
50
|
if (options.backButton.hasValue) {
|
51
|
|
- [self setBackButtonIcon:[withDefault.backButton.icon getWithDefaultValue:nil] withColor:[withDefault.backButton.color getWithDefaultValue:nil] title:[withDefault.backButton.title getWithDefaultValue:nil] showTitle:[withDefault.backButton.showTitle getWithDefaultValue:YES]];
|
|
51
|
+ [self setBackButtonOptions:[withDefault.backButton.icon getWithDefaultValue:nil] withColor:[withDefault.backButton.color getWithDefaultValue:nil] title:[withDefault.backButton.title getWithDefaultValue:nil] showTitle:[withDefault.backButton.showTitle getWithDefaultValue:YES] fontFamily:[withDefault.backButton.fontFamily getWithDefaultValue:nil] fontSize:[options.backButton.fontSize getWithDefaultValue:nil]];
|
52
|
52
|
}
|
53
|
53
|
}
|
54
|
54
|
|
|
@@ -111,21 +111,27 @@
|
111
|
111
|
}
|
112
|
112
|
}
|
113
|
113
|
|
114
|
|
-- (void)setBackButtonIcon:(UIImage *)icon withColor:(UIColor *)color title:(NSString *)title showTitle:(BOOL)showTitle {
|
115
|
|
- UIBarButtonItem *backItem = [[UIBarButtonItem alloc] init];
|
|
114
|
+- (void)setBackButtonOptions:(UIImage *)icon withColor:(UIColor *)color title:(NSString *)title showTitle:(BOOL)showTitle fontFamily:(NSString *)fontFamily fontSize:(NSNumber *)fontSize {
|
|
115
|
+ UIBarButtonItem *backItem = [[UIBarButtonItem alloc] init];
|
116
|
116
|
NSArray* stackChildren = self.navigationController.viewControllers;
|
117
|
117
|
icon = color
|
118
|
118
|
? [[icon withTintColor:color] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
|
119
|
119
|
: icon;
|
120
|
120
|
[self setBackIndicatorImage:icon withColor:color];
|
121
|
|
-
|
|
121
|
+
|
122
|
122
|
UIViewController *lastViewControllerInStack = stackChildren.count > 1 ? stackChildren[stackChildren.count - 2] : self.navigationController.topViewController;
|
123
|
123
|
|
124
|
124
|
if (showTitle) {
|
125
|
125
|
backItem.title = title ? title : lastViewControllerInStack.navigationItem.title;
|
126
|
126
|
}
|
127
|
127
|
backItem.tintColor = color;
|
128
|
|
-
|
|
128
|
+
|
|
129
|
+ if (fontFamily) {
|
|
130
|
+ CGFloat resolvedFontSize = fontSize ? fontSize.floatValue : 17.0;
|
|
131
|
+ [backItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [UIFont fontWithName:fontFamily size:resolvedFontSize], NSFontAttributeName, nil] forState:UIControlStateNormal];
|
|
132
|
+ [backItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [UIFont fontWithName:fontFamily size:resolvedFontSize], NSFontAttributeName, nil] forState:UIControlStateHighlighted];
|
|
133
|
+ }
|
|
134
|
+
|
129
|
135
|
lastViewControllerInStack.navigationItem.backBarButtonItem = backItem;
|
130
|
136
|
}
|
131
|
137
|
|