react-native-navigation的迁移库

RNNStatusBarOptions.m 732B

12345678910111213141516171819202122232425262728
  1. #import "RNNStatusBarOptions.h"
  2. @implementation RNNStatusBarOptions
  3. - (void)applyOn:(UIViewController *)viewController {
  4. if (self.blur) {
  5. UIView* curBlurView = [viewController.view viewWithTag:BLUR_STATUS_TAG];
  6. if ([self.blur boolValue]) {
  7. if (!curBlurView) {
  8. UIVisualEffectView *blur = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]];
  9. blur.frame = [[UIApplication sharedApplication] statusBarFrame];
  10. blur.tag = BLUR_STATUS_TAG;
  11. [viewController.view insertSubview:blur atIndex:0];
  12. }
  13. } else {
  14. if (curBlurView) {
  15. [curBlurView removeFromSuperview];
  16. }
  17. }
  18. }
  19. if (self.style) {
  20. [viewController setNeedsStatusBarAppearanceUpdate];
  21. }
  22. }
  23. @end