我在移动按钮时使用此代码,但在转换过程中禁用了该事件
在移动时我该怎么做? 这是我的代码......
button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame = CGRectMake(210, 285, 120, 118);
[button setTitle:@"" forState:(UIControlState)UIControlStateNormal];
[button addTarget:self action:@selector(botonTap:) forControlEvents:(UIControlEvents)UIControlEventTouchDown];
[button setBackgroundImage:[UIImage imageNamed:@"car.png"] forState:UIControlStateNormal];
[self.view addSubview:button];
移动屏幕并禁用事件完成:(
[UIView animateWithDuration:10
delay:0.0f
options: UIViewAnimationOptionAllowUserInteraction |
UIViewAnimationOptionLayoutSubviews | UIViewAnimationOptionCurveEaseIn
animations:^{
button.frame = CGRectMake(0, 4, 120, 118);
}
completion:^(BOOL finished){
}];
点按此按钮时,请不要输入此方法,只能在停止时使用:
-(IBAction)botonTap:(id)sender {
button.alpha=0;
}