2014-09-02 76 views

回答

0

如果您正在遵循該教程,您可以在動畫完成後像下面那樣簡單地按下所需的視圖控制器。只需將您的delay3方法替換爲此處的方法,並替換您想要推送的視圖控制器。

步驟 -

  1. 導入在你所寫的電流實現文件的視圖控制器頭文件 - (無效)DELAY3方法如下圖所示。

    #import "ViewController.h"

  2. 檢查下面的圖片,並與一個在你的故事板更換pushNewScreen方法的ID。

enter image description here

- (void)delay3 { 
    [UIView beginAnimations:nil context:NULL]; 
    [UIView setAnimationDuration:1.0];//you can change animation time here. 
    [Loadingimageview setAlpha:1.0]; 
    [UIView commitAnimations]; 

    // this method will call after 1 second you can change delay here. 
    [self performSelector:@selector(pushNewScreen) withObject:nil afterDelay:1.0]; 
} 

- (void)pushNewScreen { 
    ViewController *newView = [self.storyboard instantiateViewControllerWithIdentifier:@"storyBoardIdentifier"]; 
    [self.navigationController pushViewController:newView animated:YES]; 
} 
+0

它從來沒有工作過?它在延遲3加載之後沒有任何作用 – 2014-09-02 19:40:38

+0

以及通過替換您想要推送的視圖控制器的含義是什麼?我很抱歉,但非常感謝你的幫助! – 2014-09-02 19:50:52

+0

編輯答案。如果這沒有幫助,你可以給我發送代碼。 – 2014-09-03 04:33:25