首页 > 代码库 > iOS双击home键之后应用程序显示一张图片,保护应用程序隐私
iOS双击home键之后应用程序显示一张图片,保护应用程序隐私
源代码下载地址:http://download.csdn.net/detail/haogaoming123/8417041
类似于支付宝项目,在双击home键之后应用程序进入后台程序,然后这时候将应用程序页面隐藏,然后显示一样默认图片
// After didFinish addObserver accept Notification [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(userDidTakeScreenshot) name:UIApplicationDidEnterBackgroundNotification object:nil];
- (void)userDidTakeScreenshot { self.lockView = [[UIImageView alloc]initWithFrame:[UIScreen mainScreen].bounds]; UIImage *image = [UIImage imageNamed:@"Personal_logo.jpg"]; self.lockView.image = image; [self.window addSubview:self.lockView]; }
- (void)applicationDidBecomeActive:(UIApplication *)application { // 进入前台移除视图 if (self.lockView) { [self.lockView removeFromSuperview]; self.lockView = nil; } // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. }
iOS双击home键之后应用程序显示一张图片,保护应用程序隐私
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。