iphone – 浏览导航使用滑动手势
发布时间:2020-12-15 02:01:38 所属栏目:百科 来源:网络整理
导读:如何使用滑动手势垂直切换视图? 解决方法 我找到了我的答案。我发贴的代码供您参考。谢谢 :-) 在viewDidLoad UISwipeGestureRecognizer *swipeGesture = [[[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipedScreendown:)] au
如何使用滑动手势垂直切换视图?
解决方法
我找到了我的答案。我发贴的代码供您参考。谢谢 :-)
在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]; } 如果你需要更多的澄清,请发贴在这里。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |