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. }
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。