[英]How do I force my ios7 app to start on the home screen?
I have an app with multiple View Controllers. 我有一个带有多个View Controller的应用程序。 I have a Home screen with "Play / Options / etc.".
我有一个主屏幕,有“播放/选项/等”。 When you hit Play, you navigate over to the GamePlay View Controller and start playing.
当您点击Play时,您将导航到GamePlay View Controller并开始播放。
I find that if I'm in the "gameplay" VC and I hit the iPhone's Home button (leaving my app) and then re-launch my app, it puts me right back to the game screen. 我发现如果我在“游戏玩法”VC中,我点击iPhone的主页按钮(离开我的应用程序),然后重新启动我的应用程序,它会让我回到游戏屏幕。 I'd like to force the app to start on the same "Home" screen every time is it launched.
我想强制该应用程序每次启动时都在同一个“主页”屏幕上启动。
Suggestions greatly appreciated! 建议大加赞赏!
Thanks, 谢谢,
-Ed -ed
in your app's plist add the key UIApplicationExitsOnSuspend
and set it to YES
. 在你的应用程序的plist中添加密钥
UIApplicationExitsOnSuspend
并将其设置为YES
。 Your app wont be suspended and youll always start on the home screen 您的应用程序将不会被暂停,您将始终在主屏幕上启动
When you press the Home button, the application goes to background. 按Home按钮时,应用程序将转到后台。 When launched again, application just enters foreground from background.
再次启动时,应用程序只从后台进入前台。 I think you can load the home screen in the following delegate method in AppDelegate
我认为您可以在AppDelegate中的以下委托方法中加载主屏幕
- (void)applicationWillEnterForeground:(UIApplication *)application
You can preserve the state of the game (I don't want to kill that zombie again!) in the following: 你可以保留游戏的状态(我不想再杀死那个僵尸!)如下:
- (void)applicationDidEnterBackground:(UIApplication *)application
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.