react-native-navigation的迁移库

RCCToolBar.m 795B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //
  2. // RCCToolBar.m
  3. // ReactNativeControllers
  4. //
  5. // Created by Ran Greenberg on 09/05/2016.
  6. // Copyright © 2016 artal. All rights reserved.
  7. //
  8. #import "RCCToolBar.h"
  9. @interface RCCToolBarView : UIToolbar
  10. @property (nonatomic) BOOL toolBarTranslucent;
  11. @end
  12. @implementation RCCToolBarView
  13. -(instancetype)init
  14. {
  15. self = [super init];
  16. if (self)
  17. {
  18. self.toolBarTranslucent = self.translucent;
  19. }
  20. return self;
  21. }
  22. -(void)didMoveToWindow
  23. {
  24. [super didMoveToWindow];
  25. self.translucent = self.toolBarTranslucent;
  26. }
  27. @end
  28. @implementation RCCToolBar
  29. RCT_EXPORT_MODULE()
  30. - (UIView *)view
  31. {
  32. return [[RCCToolBarView alloc] init];
  33. }
  34. RCT_CUSTOM_VIEW_PROPERTY(translucent, BOOL, RCCToolBarView)
  35. {
  36. view.toolBarTranslucent = [RCTConvert BOOL:json];
  37. }
  38. @end