【问题标题】:xcode 6 - change default launch screen display timexcode 6 - 更改默认启动屏幕显示时间
【发布时间】:2014-11-25 06:45:22
【问题描述】:

在新的 Xcode 6 项目中,会创建一个默认的 LaunchScreen.xib 文件,该文件会在应用启动时短暂显示。如何更改显示的时间,例如显示 5 秒?

【问题讨论】:

标签: xcode xcode6 delay splash-screen launch-screen


【解决方案1】:

你也可以使用NSThread:

 [NSThread sleepForTimeInterval:(NSTimeInterval)];

你可以把这段代码放到applicationDidFinishLaunching方法的第一行。

例如,显示屏幕 4 秒。

文件:AppDelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    

  /*this will pause main thread for x interval seconds. 
  put on the top of application:didFinishLaunchingWithOptions, so it will not 
  proceed to show window until sleep interval is finished.*/

    [NSThread sleepForTimeInterval:4]; //add 4 seconds longer.
   //other code....
}

【讨论】:

  • 我在 Xcode 中寻找一些设置。但这也有效!谢谢!
  • 酷!我希望它不会让我的应用被拒绝。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-11-01
  • 1970-01-01
相关资源
最近更新 更多