如何使用滑动手势垂直切换 View ?
最佳答案
我找到了答案。我正在发布代码供您引用。谢谢:-)
在 viewDidLoad
UISwipeGestureRecognizer *swipeGesture = [[[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipedScreendown:)] autorelease];
swipeGesture.numberOfTouchesRequired = 1;
swipeGesture.direction = UISwipeGestureRecognizerDirectionDown;
[m_pImageView addGestureRecognizer:swipeGesture];
现在
- (void)swipedScreendown:(UISwipeGestureRecognizer*) swipeGesture {
m_pViewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
CATransition *transition = [CATransition animation];
transition.duration = 0.75;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromBottom;
transition.delegate = self;
[self.view.layer addAnimation:transition forKey:nil];
[self.view addSubview:PadViewController.view];
}
如果您需要更多说明,请在此处发帖。
关于iphone - 使用滑动手势查看导航,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6326816/