2011-10-15 29 views
0

我的要求是,無論何時啓動應用程序,我需要在屏幕底部顯示公司標誌填充屏幕圖像視圖,UITabBar禁用所有UITabBarItems。禁用iPhone應用程序啓動時的所有UITabBarItems

用戶將繼續看到這個標誌觀點,直到他選擇點擊任何tabbaritems,然後相關的視圖控制器來了

我已經試過之前設置[tabItem setEnabled:enableState];爲False appDelegates application:didfinishlaunchingwithoptions:下面但仍然沒有得到上述行爲:

self.window.rootViewController = self.tabBarController; 
[self.window makeKeyAndVisible]; 

你可以請建議如何實現這一目標?

感謝,

回答

0
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{ 
    defaultImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Default.png"]]; // enter name of image with your company logo 
    defaultImageView.frame =self.window.bounds; 

    [self.window addSubview:defaultImageView]; 


    [self.window makeKeyAndVisible]; 

    [self continueLoading]; //Load what do you want to load 


    return YES; 
} 

而且比,ofter所有加載運行此方法:

- (void) removeImageFromScreen 
{ 
    [UIView beginAnimations:nil context:NULL]; 
    [UIView setAnimationDelegate:defaultImageView]; 
    [UIView setAnimationDidStopSelector:@selector(removeFromSuperview)]; 
    [UIView setAnimationCurve:UIViewAnimationCurveEaseIn]; 
    [UIView setAnimationDuration:0.3f]; 
    defaultImageView.alpha = 0; 
    [UIView commitAnimations]; 
} 
+0

感謝您的回覆。它可以幫助我顯示一段時間的default.png。但我的要求是顯示uitabbarcontrol與此圖像沒有選擇tabbaritems(我不知道如何做到這一點)。只有玩家點擊任何tabbaritem後,該tabbaritem的屏幕纔會出現 –

1

好,我們有一個取巧的辦法了這一點,只需第一次靜態設置的UIImageView(YR閃屏視圖)從xib在一些視圖控制器的年標籤欄(僅用於截圖目的),然後你可以得到你的標籤欄與你的uiimageview(閃屏圖像)的屏幕截圖通過按下主頁按鈕和鎖定按鈕從設備。

使用該屏幕截圖PNG圖像作爲年初的屏幕uiimageview(即在上面的答案Default.png)與大框架,因此用戶不能觸摸我們的真正的標籤欄控制器。