简体   繁体   English

如何强制我的ios7应用程序在主屏幕上启动?

[英]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.

相关问题 如何按照Apple标准检查我的应用是否与iOS7兼容? - How do I check that my app is iOS7 compatible according to Apple Standards? 如何通过主屏幕上的点击图标获取iOS App启动事件? - How do I get the iOS App launch event by clicked icon from home screen? ios7上主屏幕模式下的Cookie - Cookies in Home Screen mode on ios7 如何在iPhone 5和ios 6 SDK上强制我的iPhone应用程序高度为480像素? - How do I force my iPhone app to 480 px height on iPhone 5 and ios 6 SDK? 如何有条件地为iOS7和iOS6加载资产? - How do I conditionally load assets for iOS7 and iOS6? 我可以使用iOS7 SDK构建的应用程序看起来像iOS 7中的iOS 6应用程序吗? - Can I make my app built with iOS7 SDK look like an iOS 6 app in iOS 7? 我如何编写适用于iOS 6和iOS 7的iPhone 3.5英寸屏幕和4英寸屏幕的代码 - how can i write the code for iphone 3.5 inches screen and 4 inches screen for ios6 & ios7 如何在UITableViewCell中模糊(ios7样式)图像的一部分? - How do I blur (ios7 style) a section of an image in a UITableViewCell? 如何使用 Swift 编程在 iOS 8 中退出应用程序并返回主屏幕 - How to exit app and return to home screen in iOS 8 using Swift programming 如何在iOS应用中将帧从FFmpeg渲染到屏幕? - How do I render frames from FFmpeg to the screen in an iOS app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM