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

好爽。我明白了,我现在要尝试一下,并与它一起玩,并回到你身边。谢谢一堆。 –