Ios 如何将动作目标添加到以UIAnimationTransitionFlipFromLeft样式设置动画的按钮?

Ios 如何将动作目标添加到以UIAnimationTransitionFlipFromLeft样式设置动画的按钮?,ios,animation,uitableview,uibutton,action,Ios,Animation,Uitableview,Uibutton,Action,我有一个按钮,它是从uitableViewCell上的(隐藏->取消隐藏)设置动画的 tableViewCell中有一个imageview和一个按钮位于同一个rect位置,当用户从tableview中选择一个tableViewCell时,imageview将动画设置为隐藏,按钮将动画设置为显示。其中两个视图(imageview和按钮)从xib文件加载。我向按钮添加了一个操作,并将其与iAction方法链接 我的问题:当用户触摸按钮时,动作方法没有被调用,为什么 [UIView beginAnim

我有一个按钮,它是从uitableViewCell上的(隐藏->取消隐藏)设置动画的

tableViewCell中有一个imageview和一个按钮位于同一个rect位置,当用户从tableview中选择一个tableViewCell时,imageview将动画设置为隐藏,按钮将动画设置为显示。其中两个视图(imageview和按钮)从xib文件加载。我向按钮添加了一个操作,并将其与iAction方法链接

我的问题:当用户触摸按钮时,动作方法没有被调用,为什么

[UIView beginAnimations:cell.id context:nil];
[UIView setAnimationDuration:1.0f];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(focusCellFinished:finished:context:)];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:cell.containerView cache:YES];
cell.imagePhoto.hidden = true;
cell.playButton.hidden = false;
[UIView commitAnimations];
当用户选择一个按钮时,tableView:didSelectRowAtIndexPath:将被调用,我不需要它,我只想调用button方法

顺便说一句,我知道,如果只是添加一个按钮正常而不动画消失,它可以添加一个目标行动,并被成功调用

任何回答和评论都将不胜感激,谢谢。

像这样尝试

[UIView beginAnimations:cell.id context:nil];
[UIView setAnimationDuration:1.0f];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(focusCellFinished:finished:context:)];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:cell.containerView cache:YES];
cell.imagePhoto.transform =CGAffineTransformMakeTranslation (-100,30);
cell.playButton.transform =CGAffineTransformMakeTranslation (100,30);
[UIView commitAnimations];

这里更改
CGAffineTransformMakeTranslation(x,y)的值根据你的帧位置

你好,我的朋友,谢谢你的回复。我不需要知道如何隐藏视图和显示另一个视图,我只想知道为什么动画按钮不能添加动作。你也为按钮设置了动画吗?再次感谢。现在工作正常了。我只是再次写入Xib文件。也许是因为SDK的原因。