-1

当为 UIImageView 设置动画时,它在动画期间不会发送事件,但是当它完成动画时,它能够发送事件,我也尝试过 UIButton。

4

2 回答 2

1

您只需要在调用动画时包含 UIViewAnimationOptionAllowUserInteraction 选项:

[UIView animateWithDuration:animationDuration 
                          delay:0 
                        options:(UIViewAnimationOptionCurveLinear | UIViewAnimationOptionAllowUserInteraction)
                     <snip>];
于 2012-10-17T11:01:00.983 回答
0
    CATransition *animation = [CATransition animation];
    [animation setDelegate:self];   
    [animation setType:kCATransitionFade];
    [animation setDuration:0.0];// try 0.1 also
    [animation setTimingFunction:[CAMediaTimingFunction functionWithName:
                                  kCAMediaTimingFunctionEaseInEaseOut]];
    [[yourImageView layer] addAnimation:animation forKey:@"transitionViewAnimation"];//Try   self.view insted of yourImageView if you want to animate whole view
于 2012-10-17T11:13:08.220 回答