方法1:
//
在
AppDelegate.m
里写上
- (
BOOL
)application:(
UIApplication
*)application didFinishLaunchingWithOptions:(
NSDictionary
*)launchOptions {
// Override point for customization after application launch.……
// Override point for customization after application launch.……
……
[
NSThread
sleepForTimeInterval
:
2.0
];
[self.window makeKeyAndVisible];
return
YES
;
}
方法2:
//Timer
,
Thread
都可以延时
//1 ,如果是静态的数据,启动页面想让用户看清楚,那么 sleep 延时是最简单的方法。
//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.
[ self .window addSubview:viewController.view];
[ self . window makeKeyAndVisible ];
return YES ;
}
// 在 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.
[ self .window addSubview:viewController.view];
[ self . window makeKeyAndVisible ];
return YES ;
}
//
这样
splash
页面就停留
5
秒后,消失了。