我已经在视图上附加了一个点击手势,起初它似乎可以工作,但是在动画视图之后,手势被完全忽略,直到视图回到它的原始位置。
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tap:)];
[self.cellView addGestureRecognizer:tap];
[tap release];
在这里,我为右侧的视图设置动画
[UIView animateWithDuration:0.3
delay:0.0
options:UIViewAnimationOptionAllowUserInteraction
animations:^
{
[cellView setFrame:CGRectMake(cellViewX, cellView.frame.origin.y, cellView.frame.size.width, cellView.frame.size.height)];
[editView setFrame:CGRectMake(editViewX, editView.frame.origin.y, cellView.frame.size.width, cellView.frame.size.height)];
}
completion:^(BOOL finished)
{
NSLog(@"Animation complete");
}];
完成处理程序被触发,但现在点击手势完全被忽略了。