大佬教程收集整理的这篇文章主要介绍了ios – UIScreenEdgePanGestureRecognizer无法识别右边缘的手势,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
_swipeInLeftGestureRecognizer = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self action:@SELEctor(handleSwipeInFromRightEdge:)]; _swipeInLeftGestureRecognizer.minimumnumberOfTouches = 1; _swipeInLeftGestureRecognizer.maximumnumberOfTouches = 1; [_swipeInLeftGestureRecognizer setEdges:UIRectEdgeRight]; [self.view addGestureRecognizer:_swipeInLeftGestureRecognizer]; - (void)handleSwipeInFromRightEdge:(UIGestureRecognizer*)sender { NSLog(@"swipe from right edge!!!!"); }
手势附加到视图上,没有任何内容.
我错过了什么吗?
有用. UIWindow不会自动旋转,因此我必须相应地转换触摸坐标.
这是我的转型版本:
- (CGPoint)transformPoint:(CGPoint)point { CGPoint poinTinView = point; if ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPorTraitUpsideDown) { poinTinView.x = self.bounds.size.width - poinTinView.x; poinTinView.y = self.bounds.size.height - poinTinView.y; } else if ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationLandscapeLeft) { CGFloat x = poinTinView.x; CGFloat y = poinTinView.y; poinTinView = CGPointMake(self.bounds.size.height - y,X); } else if ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationLandscapeRight) { CGFloat x = poinTinView.x; CGFloat y = poinTinView.y; poinTinView = CGPointMake(y,self.bounds.size.width - X); } return poinTinView; }
以上是大佬教程为你收集整理的ios – UIScreenEdgePanGestureRecognizer无法识别右边缘的手势全部内容,希望文章能够帮你解决ios – UIScreenEdgePanGestureRecognizer无法识别右边缘的手势所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。