【发布时间】:2016-06-04 05:44:11
【问题描述】:
我有一个带有水平 UICollectionView 和两个 UIButton 的视图(固定在右侧和左侧,屏幕宽度为 25%)。
当我开始拖动按钮时,我需要滚动 collectionView 而不会丢失按钮的点击手势。
我试图覆盖我的按钮的 touchesMoved 并将触摸和事件发送到我的 collectionView 但它不起作用。
- (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
[super touchesMoved:touches withEvent:event];
if (self.delegate && [self.delegate respondsToSelector:@selector(buttonDidTouchesMoved:withEvent:)]) {
[self.delegate buttonDidTouchesMoved:touches withEvent:event];
}
}
我该怎么办?
谢谢。
【问题讨论】:
标签: ios objective-c uibutton uicollectionview