1

我正在關閉基本導航模板,該模板包含一個擁有導航欄等的主視圖,並在構建應用程序時最終加載視圖。UIView在導航視圖中更改

我想知道如何讓它在用戶瀏覽器中瀏覽多個視圖,而不需要添加任何內容到導航堆棧中,就像通常在導航器應用中更改視圖時一樣。

我打算轉型這些意見將與滑動手勢的方式..

任何幫助,將不勝感激,希望我已經解釋了我的問題不夠好,因爲它相當困難的事情來解釋。

回答

1

我會談談這個使用UIScrollView與分頁。

但是這並不爲你工作的情況下,試試這個:

- (void) swipedScreen:(id) sender { 
    //I'll leave getNewView to you to implement based on how you want to get the new view 
    UIView *newView = [self getNewView]; 
    self.view = newView; 
} 

- (void) setupSwipeGestureRecognizer { 
    UISwipeGestureRecognizer *swipeGesture = [[[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipedScreen:)] autorelease]; 
    swipeGesture.direction = (UISwipeGestureRecognizerDirectionUp|UISwipeGestureRecognizerDirectionDown); 
    [window addGestureRecognizer:swipeGesture]; 
} 

- (void) viewDidLoad { 
    [self setupSwipeGestureRecognizer]; 
} 

而且不要忘記刪除手勢識別,無論你覺得合適。

+0

好爽。我明白了,我現在要嘗試一下,並與它一起玩,並回到你身邊。謝謝一堆。 –