【发布时间】:2025-12-05 08:05:02
【问题描述】:
在cellForRowAtIndexPath创建cell时,我还把UIPanGestureRecognizer添加到cell,并根据要求实现了所有处理。
这个Tableview包含在myViewController中,而myViewController又包含在UINavigationController中。
使用UIPanGestureRecognizer UINavigationController 向后滑动不起作用。
当用户开始从手机的最左侧滑动时,我该怎么做?它执行 UINavigationController swipe to back 而不是我的手机平移手势。
-(void)move:(PanGestureRecognizer *)gesture {
CGPoint location = [gesture locationInView:self];
NSIndexPath *swipedIndexPath = [self indexPathForRowAtPoint:location];
TableViewCell *swipedCell = [self cellForRowAtIndexPath:swipedIndexPath];
CGRect cellRect = swipedCell.frame;
if(location.x < 75) {
?????
}
.
.
.
//my pan gesture required functionality
}
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
return YES;
}
【问题讨论】:
标签: ios objective-c uinavigationcontroller uipangesturerecognizer uiswipegesturerecognizer