我是iPhone開發者的初學者,我正在開發我的第一批應用程序。實際上,我已經創建了一個Tab Bar應用程序,但是我想在運行應用程序時添加Splash Screen。TabBarController之前的開機畫面
我發現了一個問題,究竟在Loading a Welcome Screen(Splash Screen) before TabBarController
但是當我嘗試把我的代碼,閃屏不加載,只是繼續顯示我的tabbarcontroller。
我創建了一個SplashViewController.h,SplashViewController.m和SplashView.xib和下面是我的代碼,
#import "SplashViewController.h"
...
...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
SplashViewController *controller = [[SplashViewController alloc] initWithNibName:@"SplashView" bundle:nil];
[self.tabBarController presentModalViewController:controller animated:YES];
[controller release];
// Add the tab bar controller's view to the window and display.
[self.window addSubview:tabBarController.view];
[self.window makeKeyAndVisible];
return YES;
}
的應用程序運行沒有錯誤,但只是無法加載啓動畫面,任何意見表示高度讚賞。謝謝!
你的SplashScreenController是做什麼的?你在.xib中定義了任何可見的東西嗎?如果你想要一個靜態圖像,你可以命名id Default.png並把它放在你的包中,不需要其他代碼。 – Rayfleck 2011-04-01 14:20:49
右鍵,在將圖像文件重命名爲Default.png後,在啓動應用程序時可以看到它,但我想保留它,直到用戶按下任何關閉的位置。任何建議?謝謝! – TonyNet 2011-04-01 14:39:37