2
我已將一個輕擊手勢附加到視圖,起初它似乎工作,但在動畫之後視圖手勢完全被忽略,直到視圖回到其原始位置。UITapGestureRecognizer在動畫後被忽略
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");
}];
,但現在的點觸手勢完全被忽略。