Преглед изворни кода

Revert "Support styling on back button on iOS (#3755)" (#3989)

This reverts commit f2635f1116.
Guy Carmeli пре 6 година
родитељ
комит
fe2ca84500
No account linked to committer's email address
2 измењених фајлова са 2 додато и 29 уклоњено
  1. 0
    2
      lib/ios/RNNBackButtonOptions.h
  2. 2
    27
      lib/ios/RNNBackButtonOptions.m

+ 0
- 2
lib/ios/RNNBackButtonOptions.h Прегледај датотеку

@@ -8,7 +8,5 @@
8 8
 @property (nonatomic, strong) NSString* transition;
9 9
 @property (nonatomic, strong) NSNumber* showTitle;
10 10
 @property (nonatomic, strong) NSNumber* color;
11
-@property (nonatomic, strong) NSString* fontFamily;
12
-@property (nonatomic, strong) NSNumber* fontSize;
13 11
 
14 12
 @end

+ 2
- 27
lib/ios/RNNBackButtonOptions.m Прегледај датотеку

@@ -15,36 +15,11 @@
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 {
19
-		NSString *title;
20
-		
21
-		title = self.title ? self.title : viewController.navigationItem.title;
22
-		UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithTitle:title
18
+	} else if (self.title) {
19
+		UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithTitle:self.title
23 20
 																	 style:UIBarButtonItemStylePlain
24 21
 																	target:nil
25 22
 																	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
-		}
48 23
 		
49 24
 		[self setBackItem:backItem onViewController:viewController];
50 25
 	}