在进入后台之前阻止iOS进行应用程序的屏幕截图 [英] Prevent iOS from taking screen capture of app before going into background

查看:167
本文介绍了在进入后台之前阻止iOS进行应用程序的屏幕截图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您可能都知道iOS会在将应用程序投射到后台之前对其进行屏幕截图。这通常是为了获得更好的用户体验,例如快速动画来恢复应用程序等等。我不希望我的应用程序屏幕截图存储在设备上,但我希望多任务仍然存在。

You all might know that iOS takes a screen shot of your application before throwing it into the background. This is usually for a better User experience like quick animation to bring the app back and so on. I don't want my app screen shot to be stored on the device, but I want the multitasking to still exist.

我出来了一个解决方案,但我是不确定我是否正朝着正确的方向前进。因此,当调用 applicationDidEnterBackground 时 - 我放入了一个将由操作系统捕获的叠加图像,一旦应用程序进入前景,我将删除叠加层。我不确定这是否会起作用,但我正在实现这一目标。同时,对此的任何其他想法将帮助我找出攻击此问题的最佳方式。

I came out with a solution but I'm not sure if I'm heading in the right direction. So, when the applicationDidEnterBackground is called -- I put in an overlay image that will be captured by the OS, and once the app enters foreground, I will remove the overlay. I'm not sure if this is going to work but I'm on my way to implement this. Meanwhile, any other thoughts on this will help me figure out the optimal way of attacking this issue.

推荐答案

你在右边跟踪。这是Apple建议的方法如上所述在iOS应用程序编程指南中:

You are on the right track. This is Apple's recommended way to do this as noted in the iOS Application Programming Guide:


在移至后台之前从视图中删除敏感信息。当应用程序转换为后台时,系统会拍摄应用程序主窗口的快照,然后在将应用程序转换回前台时会快速显示该窗口。在从 applicationDidEnterBackground:方法返回之前,您应该隐藏或隐藏可能作为快照的一部分捕获的密码和其他敏感个人信息。

Remove sensitive information from views before moving to the background. When an application transitions to the background, the system takes a snapshot of the application’s main window, which it then presents briefly when transitioning your application back to the foreground. Before returning from your applicationDidEnterBackground: method, you should hide or obscure passwords and other sensitive personal information that might be captured as part of the snapshot.

这篇关于在进入后台之前阻止iOS进行应用程序的屏幕截图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆