applicationWillEnterForeground 上的短期 UI 冻结

发布于 2024-11-29 14:59:08 字数 326 浏览 2 评论 0原文

我有一个应用程序,从非活动状态(安全视图)恢复时需要输入。当一段时间后从非活动状态恢复时,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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

挽清梦 2024-12-06 14:59:08

您是否包含此视图的屏幕截图作为启动图像?当应用程序加载时,它可能只显示此屏幕截图,并给人以应用程序已冻结的印象,因为它不允许用户在屏幕截图上输入。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文