将默认的interactivePopGestureRecognizer扩展到屏幕边缘以外? [英] Extend default interactivePopGestureRecognizer beyond screen edge?

查看:125
本文介绍了将默认的interactivePopGestureRecognizer扩展到屏幕边缘以外?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 UIViewController 被推送到导航堆栈。我想扩展标准的iOS7交互式平移手势,将此视图控制器弹出超出默认 UIRectEdgeLeft 边界,以便用户可以通过从任何位置进行平移来启动交互式后退操作风景。

I have a UIViewController that gets pushed onto a navigation stack. I'd like to extend the standard iOS7 interactive pan gesture to pop this view controller beyond the default UIRectEdgeLeft boundaries, so that users can initiate an interactive back action by panning from anywhere on the view.

我已尝试滚动自己的交互式视图控制器转换,但要完全复制默认 interactivePopGestureRecognizer的良好视差处理是很麻烦的。例如, fromViewController 隐藏导航栏,而 toViewController 显示它 - 这是一个不容易处理的东西自定义交互式转换,但在默认操作中是无缝的。

I've tried rolling my own interactive view controller transition, but it's a lot of hassle to fully replicate the nice parallax handling of the default interactivePopGestureRecognizer. For example, the fromViewController hides the navigation bar, while the toViewController shows it—something that is not easy to handle in a custom interactive transition, but is seamless in the default action.

因此,我想将默认操作扩展到更大的平移手势区域,但是API似乎不支持简单地替换手势。

As a result, I want to extend the default action to a larger area of pan gesture, but the API doesn't seem to support simply replacing the gesture.

任何有创意的建议?

推荐答案

查看我的图书馆 SloppySwiper ,使用 UIPanGestureRecognizer实现此目的并重新创建默认动画。您还可以在 https://github.com/fastred/SloppySwiper/issues/1 <中查看我的想法/ a>。

Check out my library SloppySwiper, which achieves this by using UIPanGestureRecognizer and by recreating the default animation. You can also see my ideas in https://github.com/fastred/SloppySwiper/issues/1.

这篇关于将默认的interactivePopGestureRecognizer扩展到屏幕边缘以外?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆