2012-08-17 97 views
0

使用的是iOS 5的目的是提上了閃屏視圖按鈕,這個不能做的是爲Default.png靜態圖片等什麼我做的是儘快呈現出modalViewController作爲第一個Viewcontroller出現。這恰好是由TabController託管的ViewController。問題是,只要Splash屏幕消失並顯示SplashViewController(使用相同的圖像但處於活動狀態),用戶可以短暫地看到下方的視圖,但存在一個小差距。後顯示modalVIewController立即閃屏

我正在使用presentModalViewController來顯示活動的飛濺視圖。有沒有什麼辦法擺脫這個毛病,我在基礎viewcontroller的viewWillAppear方法中調用presentModalViewController。我想我需要的是某種方式展示活動啓動畫面比這更早一點

感謝

+0

你有沒有嘗試在底層控制器的init方法中做到這一點? – 2012-08-17 10:20:09

回答

0

是的,你可以做到這一點 - 我的應用程序做到這一點沒錯。我所做的就是在「didFinishLaunchingWithOptions:」我第一次在一個UIImageView添加相同的啓動圖像作爲窗口的子視圖:

UIImageView *launchView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Default.png"]]; 
UIImageView *normalView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:<shorter version of launch image, allowing space for activity bar]]; 

[window addSubview:launchView]; 
if(isMember) { 
    [window addSubview:normalView]; 
    normalView.alpha = 0; 

    [UIView animateWithDuration:0.25 animations:^ 
     { 
      launchView.alpha = 0; 
      normalView.alpha = 1; 
     } 
     completion:^(BOOL finished) 
     { 
      [launchView removeFromSuperview]; 
     } ]; 
} 

[window makeKeyAndVisible]; 

然後加入tabbarcontroller,導航控制器與一個RootViewController的。你可以設置viewController,也可以將modalController backgroundColor設置爲clearColor - 你將不得不玩弄這個。