方法1:
在AppDelegate.m里写上
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[NSThread sleepForTimeInterval:2.0];
[_window makeKeyAndVisible];
// Override point for customization after application launch.
return YES;
}
方法2:
Timer ,Thread都可以延时
1,如果是静态的数据,启动页面想让用户看清楚,那么sleep延时是最简单的方法。
2,如果是要动态显示加载进度,应用信息,就要字定义view,延时消失。
方法3:
iPhone开发实现splash画面非常简单,做一个全屏的欢迎页的图片,把它命名为Default.png,然后放在Xcode工程的Resource里面。
在XXXAppDelegate.m程序中,插入如下代码:
- (BOOL)application:(UIApplication*)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//–inserta delay of 5 seconds before the splash screendisappears–
[NSThread sleepForTimeInterval:5.0];
//Override point for customization after applicationlaunch.
//Add the view controller’s view to the window anddisplay.
[windowaddSubview:viewController.view];
[windowmakeKeyAndVisible];
return YES;
}
这样splash页面就停留5秒后,消失了。
网友评论