简体   繁体   English

iOS从左向右滑动到上一页,并带有手势效果示例

[英]iOS swipe left to right to previous page with gesture effect example

Currently, I did when user go back previous page they have two options to do. 目前,当用户返回上一页时,我做了两个选择。 1. Click back button 2. Swipe left to right 1.单击后退按钮2.从左向右滑动

Both function called following code to go back previous page. 这两个函数都调用了以下代码以返回上一页。

[self.navigationController popViewControllerAnimated:YES];

But my client want gesture effect which is included in iOs7 onward as per following image. 但是我的客户想要手势效果,该效果包括在iOs7中,如下图所示。 Please let me know how to solve that feature. 请让我知道如何解决该功能。

在此处输入图片说明

The easiest way is to use a UIPageViewController. 最简单的方法是使用UIPageViewController。 However that is a different form of navigation than pushing/popping onto a navigation controller. 但是,这是与推送/弹出导航控制器不同的导航形式。

If you want to trigger pushes/pops you will need to attach a pan gesture recognized to your view, and then implement a custom view controller transition. 如果要触发按下/弹出,则需要在视图上附加一个平移手势,然后实现自定义视图控制器转换。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM