如何延迟Default.png?
如何延迟应用程序加载以更长时间地显示启动屏幕?
How can I delay the app loading to show the splash screen for longer?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
如何延迟应用程序加载以更长时间地显示启动屏幕?
How can I delay the app loading to show the splash screen for longer?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(6)
您应该让应用程序照常启动,然后使出现的第一个视图具有与初始屏幕相同的图像。启动计时器,然后在几秒钟后将该视图替换为真实的应用程序根视图。
故意推迟实际的应用程序启动是一个很大的禁忌。
You should let the app start as usual then make the first view that appears have the identical image on it as the splash screen. Start a timer and then replace that view with your real application root view after a few seconds.
Deliberately delaying the actual application launch is a big no-no.
更新:不,说真的,不要这样做!
或者我们使用 C 函数
将其放入 applicationDidFinishLaunching: 将使程序暂停 9 秒,也可以输入任何其他整数。
编辑:在过去的一年里我学到了很多东西。不要这样做。原因是如果启动时间过长,跳板会自动停止应用程序启动。该时间记录很少,因此即使一秒钟也可能导致应用程序失败。
UPDATE: No seriously, DON'T do this!
Or us the C function
Putting this in applicationDidFinishLaunching: will cause you program to pause for 9 seconds, any other integer may be entered as well.
EDIT: I've learned a lot in the past year. Don't do this. The reason being that the springboard will automatically stop the app launching if it takes too long. That timing is poorly documented so even one second can result in the app failing.
这个问题是类似的: splash screen like tap tap heaven 3
基本上,在您的 applicationDidFinishLaunching: 中,在包含 Default.png 的其他视图之上添加一个图像视图。
This question is similar: splash screen like tap tap revenge 3
Basically, in your applicationDidFinishLaunching:, add an image view on top of other views containing your Default.png.
请参阅上面的讨论,了解为什么您不应该以这种方式延迟应用程序加载。但是,如果您碰巧遇到这样的情况,即短时间睡眠比切换视图的开销更可取,请使用 NSThread 的 sleepForTimeIntervale 而不是 sleep()。它对框架更加友好,并且您可以更精细地控制睡眠时间:
See the above discussion of why you probably should not delay your app load in this way. But if you happen to have a scenario where sleeping for short duration would be preferable to the overhead of switching out a view, use NSThread's sleepForTimeIntervale instead of sleep(). It's more framework friendly and you have more granular control over the sleep time:
我遇到过这样的情况:客户必须演示启动图像。所以,这就是我的解决方案..
{
}
I had a situation where the client had to demo the launch image. So, this was my solution..
{
}
你可以使用它的 sleep 方法来得到这个结果”
”,如果你想获取它的启动时间,请执行以下操作:
它将延迟启动 8 秒
警告:但苹果不推荐这样做,因为它会监视你的应用程序加载时间很长,它会杀死你的应用程序。应用程序。
但是,如果您需要它来获取某些特定的屏幕截图或用于某些内部使用,您可以使用它来解决问题,但永远不要在应用程序提交中使用。
You can use it sleep method to get this result "
", If you want to get it launch time, do like :
It will delay the launch by 8 seconds
Warning : But it is not recommended by apple, as it will the watchdod about long time for your app loading, It can kill your app.
But incase if you need it to get some specific screenshot or for some in-house use, you can use to solve for purpose but never in app submission.