1黑马币
经过我的实验,都是只能在动画快结束时能被点击,偏移过程中无法点击。不知道是为什么?
代码如下:(useAutolayout已取消)
#import "ViewController.h"
@interface ViewController ()
@property (weak, nonatomic) IBOutlet UIButton *btnImg;
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
NSLog(@"btnImg.frame=%@",NSStringFromCGRect(self.btnImg.frame));
self.btnImg.frame = CGRectMake(100, 0, 200, 200);
[self.btnImg addTarget:self action:@selector(btNc) forControlEvents:UIControlEventTouchUpInside];
NSLog(@"btnImg.frame=%@",NSStringFromCGRect(self.btnImg.frame));
[UIView animateWithDuration:10 delay:1 options:UIViewAnimationOptionAllowUserInteraction animations:^{
self.btnImg.frame = CGRectMake(100, 400, 200, 200);
NSLog(@"userInteractionEnabled = %d",self.btnImg.userInteractionEnabled);
NSLog(@"Enabled = %d",self.btnImg.enabled);
} completion:nil];
} |
|