方法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都可以延時(shí)
1,如果是靜態(tài)的數(shù)據(jù),啟動(dòng)頁(yè)面想讓用戶看清楚辽聊,那么sleep延時(shí)是最簡(jiǎn)單的方法具被。
2蛤袒,如果是要?jiǎng)討B(tài)顯示加載進(jìn)度嘹锁,應(yīng)用信息艺糜,就要字定義view幢妄,延時(shí)消失兔仰。
方法3:
iPhone開發(fā)實(shí)現(xiàn)splash畫面非常簡(jiǎn)單,做一個(gè)全屏的歡迎頁(yè)的圖片磁浇,把它命名為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頁(yè)面就停留5秒后无虚,消失了。