|
@@ -15,11 +15,36 @@
|
15
|
15
|
|
16
|
16
|
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithImage:image style:UIBarButtonItemStylePlain target:nil action:nil];
|
17
|
17
|
[self setBackItem:backItem onViewController:viewController];
|
18
|
|
- } else if (self.title) {
|
19
|
|
- UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithTitle:self.title
|
|
18
|
+ } else {
|
|
19
|
+ NSString *title;
|
|
20
|
+
|
|
21
|
+ title = self.title ? self.title : viewController.navigationItem.title;
|
|
22
|
+ UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithTitle:title
|
20
|
23
|
style:UIBarButtonItemStylePlain
|
21
|
24
|
target:nil
|
22
|
25
|
action:nil];
|
|
26
|
+
|
|
27
|
+ if (self.color) {
|
|
28
|
+ [backItem setTintColor:[RCTConvert UIColor:self.color]];
|
|
29
|
+ }
|
|
30
|
+
|
|
31
|
+ if(self.fontFamily || self.fontSize) {
|
|
32
|
+ NSNumber* fontSize = self.fontSize;
|
|
33
|
+ NSString* fontFamily = self.fontFamily;
|
|
34
|
+ NSMutableDictionary* textAttributes = [[NSMutableDictionary alloc] init];
|
|
35
|
+ UIFont *font;
|
|
36
|
+
|
|
37
|
+ if (!fontSize) {
|
|
38
|
+ fontSize = [[NSNumber alloc] initWithInt: 18];
|
|
39
|
+ }
|
|
40
|
+ font = fontFamily ?
|
|
41
|
+ [UIFont fontWithName:fontFamily size:[fontSize floatValue]] :
|
|
42
|
+ [UIFont systemFontOfSize:[fontSize floatValue]];
|
|
43
|
+ [textAttributes setObject:font forKey:NSFontAttributeName];
|
|
44
|
+
|
|
45
|
+ [backItem setTitleTextAttributes:textAttributes forState:UIControlStateNormal];
|
|
46
|
+ [backItem setTitleTextAttributes:textAttributes forState:UIControlStateHighlighted];
|
|
47
|
+ }
|
23
|
48
|
|
24
|
49
|
[self setBackItem:backItem onViewController:viewController];
|
25
|
50
|
}
|