applicationWillEnterForeground 上的短期 UI 冻结
我有一个应用程序,从非活动状态(安全视图)恢复时需要输入。当一段时间后从非活动状态恢复时,UI 将冻结 1-5 秒,然后才能在安全视图上进行输入。在使用 Instruments 后,我发现当其他应用程序需要内存时,一些视图已被释放。按预期工作。
当批次已被释放并且应用程序正在重新构建释放的视图时,UI 冻结似乎会发生。我看到 viewDidLoad 发生火灾等。问题是,安全视图已经出现,让用户期望他们可以输入密码。该应用程序暂时没有响应,这让用户感到不安。
我想更好地处理这个问题,也许仅当应用程序准备好接受用户输入时才显示安全视图。
有什么好的方法可以做到这一点,或者还有其他建议吗?
I have an app which requires input when resuming from inactive state (a security view). When resuming from inactive after some time, the UI will freeze for 1-5 seconds before entry can take place on the security view. Following this with Instruments, I see some views have been dealloc'd when memory is needed for other apps. Works as it's supposed to.
The UI freeze appears to happen when lots has been dealloc'd, and the app is reconstituting the dealloc'd views. I'm seeing viewDidLoad's fire etc. Trouble is, the security view has already appeared, giving the user the expectation they can enter their passcode. The app is temporarily unresponsive, which is disconcerting to the user.
I would like to deal with this better, perhaps displaying the security view only when the app is ready for user input.
What's a good way to do that, or is there another suggestion?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否包含此视图的屏幕截图作为启动图像?当应用程序加载时,它可能只显示此屏幕截图,并给人以应用程序已冻结的印象,因为它不允许用户在屏幕截图上输入。
Have you included a screenshot of this view as the launch image? It's possible that while the app is loading, it's just showing this screenshot, and giving the impression that the app is frozen, as it won't allow user input on the screenshot.