您的位置:首页 > 产品设计 > UI/UE

使用UIScreenEdgePanGestureRecognizer写iOS7侧边栏

2014-06-04 16:49 351 查看

使用UIScreenEdgePanGestureRecognizer写iOS7侧边栏



A UIScreenEdgePanGestureRecognizer looks for panning (dragging) gestures that start near an edge of the screen. The system uses screen edge gestures in some cases to initiate view controller transitions. You can use this class to
replicate the same gesture behavior for your own actions.
UIScreenEdgePanGestureRecognizer看起来像pan手势,它是检测屏幕边缘的pan手势的。系统在某些controller转场的时候会使用这个手势。你也可以使用这个手势做其他的事情。
源码:


RootViewController.m


处理手势:



效果如下图:



如果想与其他手势并发操作,实现如下代理即可:
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {

return YES;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: