iOS应用显示最后显示的视图而不是启动屏幕-但仅在某些情况下 [英] iOS app shows last shown view instead of splash screen- but only sometimes

查看:61
本文介绍了iOS应用显示最后显示的视图而不是启动屏幕-但仅在某些情况下的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时候,当我打开我的应用程序时(要么在它休眠一段时间后恢复它,或者在它退出后打开它),启动屏幕(基本上只是说正在加载")没有显示.该应用程序显示退出该应用程序之前似乎显示的最后一个视图,而不是加载屏幕.这很糟糕,因为它使应用程序看起来好像在未加载时就已加载,即使只是在加载,它似乎也没有响应.以前有没有人经历过类似的事情?

Sometimes when I open my app (either while resuming it after it was dormant for a while or while opening it after it has been 'quit'), the splash screen, which basically just says 'loading,' doesn't show. The app shows what seems to be the last shown view before the app was quit instead of the loading screen. This is bad because it makes it appear that the app has loaded when it has not and it seems like it is unresponsive even though it's just loading. Has anyone experienced anything like this before?

我熟悉iOS的行为,该行为会在暂停时拍摄图片并将其用作简历图片.但是,当应用程序已经退出(按下主屏幕按钮,然后按两次主屏幕按钮,点击并按住应用程序图标,然后单击红色短划线并退出它)并重新启动时,它不会使用启动键屏幕在下次启动时仍然使用最后显示的视图.我可以强制该应用始终使用初始屏幕吗?

I am familiar with the iOS behavior which takes a picture on pause and uses it as a resume picture. Yet when the app has been quit (pressed home button, then hit home button twice, tap and hold app icon, then hit the red dash and quit it) and restarted, it doesn't use the splash screen on the next startup and still uses that last shown view. Can I force the app to always use the splash screen?

推荐答案

问题的原因是我在applicationWillTerminate:上执行了长时间的操作,这使应用程序的真正"终止延迟了一小会儿(我假设).因此,当我在关闭应用程序后立即重新打开该应用程序时,此操作(将数据写入磁盘)仍在进行,因此该应用程序并未真正退出.我认为这是我可以推断出的问题.

The cause of the problem was that I was performing a long-ish operation upon applicationWillTerminate:, which delayed the 'true' termination of the app for a short bit (I assume). So, when I re-open the app right after closing it, this operation (writing data to disk) is still going on, so the app hasn't truly been quit. This is what I believe is the issue from what I can deduce.

这篇关于iOS应用显示最后显示的视图而不是启动屏幕-但仅在某些情况下的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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