回答

0

基本的解決方案可能是這樣的:

- (void)viewDidLoad 
{ 
    [super viewDidLoad]; 

    // create and position the subviews, if necessary 
    self.subview1 = ... 
    self.subview2 = ... 
    self.view addSubview:self.subview1]; 
    self.view addSubview:self.subview2]; 
} 

- (void)viewWillAppear 
{ 
    [super viewWillAppear]; 
    [self showFirstView]; 
} 

- (void)showFirstView 
{ 
    self.subview1.hidden = NO; 
    self.subview2.hidden = YES; 
    [self performSelector:@selector(showSecondViewView) withObject:nil afterDelay:5]; 
} 

- (void)showSecondViewView 
{ 
    self.subview1.hidden = YES; 
    self.subview2.hidden = NO; 
} 
+0

如果他在談論有它發生的2-3秒後,他會想用'[的NSTimer scheduledTimerWithTimeInterval:2.0目標:自我選擇:@選擇(showSecondView )userInfo:nil repeats:NO];'in'viewDidLoad'或'viewWillAppear'。 – AdamPro13 2014-10-16 16:43:55

+0

當然,這就是我的代碼所做的。初始狀態(由showFirstView創建)將在視圖控制器出現後保持5秒鐘,然後將顯示secondView。 – Macondo2Seattle 2014-10-16 17:17:28

+0

哎呀,沒有一直滾動。好決定。 – AdamPro13 2014-10-16 18:07:25

相關問題