给iPhone添加splash页面又一法

现在发现有一个更简单的方法。

1. 将你需要的splash界面的图片,存成Default.png
2. 在XXXAppDelegate.m程序中,插入如下代码:

1
2
3
4
5
6
7
8
9
10
11
12
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    //--insert a delay of 5 seconds before the splash screen disappears--
    [NSThread sleepForTimeInterval:5.0];
    // Override point for customization after application launch.
    // Add the view controller’s view to the window and display.
    [window addSubview:viewController.view];
    [window makeKeyAndVisible];
    return YES;
}
 
这样splash页面就停留5秒后,消失了。

你可能感兴趣的:(application,iPhone,delay)