app前后台切换信息的保护

2022-08-01  本文已影响0人  乐此不疲吶

切换后换上高斯模糊

iOS

@property (nonatomic, strong) UIVisualEffectView *backView;

- (void)applicationWillResignActive:(UIApplication *)application {
  UIBlurEffect *beffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
  backView = [[UIVisualEffectView alloc] initWithEffect:beffect];
  backView.frame = [self.window frame];
  [self.window addSubview:backView];
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
  if (backView != nil) {
    [backView removeFromSuperview];
    backView = nil;
  }
}

Android: 不会

上一篇下一篇

猜你喜欢

热点阅读