自定义NavigationController返回手势
来源:互联网 发布:php b2b2c开发 编辑:程序博客网 时间:2024/05/17 04:44
1.定义返回手势的枚举类型
typedef NS_ENUM(NSUInteger, InteractivePopGestureRecognizerType) {
InteractivePopGestureRecognizerNone, //没有返回手势
InteractivePopGestureRecognizerEdge, //边缘返回手势
InteractivePopGestureRecognizerFullScreen //全屏返回手势
};
2.设置返回手势类型
@property (nonatomic, assign) InteractivePopGestureRecognizerType interactivePopGestureRecognizerType;
3.重写设置返回手势的方法
#pragma mark - 判断滑动返回手势方式
- (void)setInteractivePopGestureRecognizerType:(InteractivePopGestureRecognizerType)interactivePopGestureRecognizerType{
switch (interactivePopGestureRecognizerType) {
case 0:
break;
case 1:
{
//添加边缘返回手势
UIScreenEdgePanGestureRecognizer *edgePanGestureRecognizer = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self action:@selector(panGestureRecognizer:)];
edgePanGestureRecognizer.edges = UIRectEdgeLeft;
[self.view addGestureRecognizer:edgePanGestureRecognizer];
}
break;
case 2:
{
//添加全屏返回手势
UIPanGestureRecognizer *panGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGestureRecognizer:)];
[self.interactivePopGestureRecognizer.view addGestureRecognizer:panGestureRecognizer];
}
break;
default:
break;
}
}
0 0
- 自定义NavigationController返回手势
- 自定义navigationController的左侧按钮后返回手势失灵解决办法
- navigationcontroller的手势滑动返回
- NavigationController自定义返回按钮
- 自定义navigationcontroller返回动画
- NavigationController的视图,滑动手势返回
- 自定义滑动返回手势
- navigationController返回
- IOS7 自定义手势返回 interactivePopGestureRecognizer
- 自定义全屏滑动返回手势
- 自定义 NavigationController
- iOS7 NavigationController 手势问题
- iOS7 NavigationController 手势问题
- ios开发 向右滑动手势实现返回.在NavigationController中如何设置
- ios开发 向右滑动手势实现返回.在NavigationController中如何设置
- iOS 在NavigationController 基类中 自定义全局后退按钮 且 开启手势后退
- 自定义pop返回手势 利用runtime
- iOS7 NavigationController 手势问题 interactivePopGestureRecognizer
- 2016.06.14廖雪峰JS__学习笔记(对象部分)__P5
- bootstrap tooltip不起作用
- 在SQL Sever中,Null与任何字符串拼接后的结果还是Null的解决办法
- spring aop 异步处理系统日志
- 常见视频文件的编码方式和封装格式
- 自定义NavigationController返回手势
- spring mybatis sqlSessionFactory
- Android系统apps之Setting选项Language & input的隐藏(基于android4.2.2)
- HTML之marquee标签详解
- Walls and Gates
- Docker 网络(三)——容器间互访 link
- IOS AFNetWorking 3.0用法步骤详解
- webservice的简单调用方法之一
- 关于“echo -e”输出内容带 “-e”的问题