浏览代码

backButtonImage support

yogevbd 7 年前
父节点
当前提交
5026a10ae9
共有 2 个文件被更改,包括 5 次插入0 次删除
  1. 1
    0
      lib/ios/RNNTopBarOptions.h
  2. 4
    0
      lib/ios/RNNTopBarOptions.m

+ 1
- 0
lib/ios/RNNTopBarOptions.h 查看文件

18
 @property (nonatomic, strong) NSNumber* largeTitle;
18
 @property (nonatomic, strong) NSNumber* largeTitle;
19
 @property (nonatomic, strong) NSString* testID;
19
 @property (nonatomic, strong) NSString* testID;
20
 @property (nonatomic, strong) RNNTitleOptions* title;
20
 @property (nonatomic, strong) RNNTitleOptions* title;
21
+@property (nonatomic, strong) NSNumber* backButtonImage;
21
 
22
 
22
 @property (nonatomic, strong) NSString* componentName;
23
 @property (nonatomic, strong) NSString* componentName;
23
 @property (nonatomic, strong) NSString* backgroundComponentName;
24
 @property (nonatomic, strong) NSString* backgroundComponentName;

+ 4
- 0
lib/ios/RNNTopBarOptions.m 查看文件

145
 		_navigationButtons = [[RNNNavigationButtons alloc] initWithViewController:(RNNRootViewController*)viewController];
145
 		_navigationButtons = [[RNNNavigationButtons alloc] initWithViewController:(RNNRootViewController*)viewController];
146
 		[_navigationButtons applyLeftButtons:self.leftButtons rightButtons:self.rightButtons];
146
 		[_navigationButtons applyLeftButtons:self.leftButtons rightButtons:self.rightButtons];
147
 	}
147
 	}
148
+	
149
+	UIImage *image = self.backButtonImage ? [RCTConvert UIImage:self.backButtonImage] : nil;
150
+	[[UINavigationBar appearance] setBackIndicatorImage:image];
151
+	[[UINavigationBar appearance] setBackIndicatorTransitionMaskImage:image];
148
 }
152
 }
149
 
153
 
150
 -(void)storeOriginalTopBarImages:(UIViewController*)viewController {
154
 -(void)storeOriginalTopBarImages:(UIViewController*)viewController {