我有一个带有按钮的视图,当通过简单的翻译点击它时,它会向上移动。但是,当使用 CGAffineTransformTranslate 时,UIButton 似乎也向下移动了几个点。我该如何补救这个动画?
- (IBAction)moveButton:(id)sender {
UIButton *button = (UIButton *)sender;
[UIView animateWithDuration:2.4f
delay:0.0f
options:UIViewAnimationOptionCurveEaseInOut
animations:^{
button.transform = CGAffineTransformTranslate(button.transform, 0, -49);
}
completion:^(BOOL finished){}
];
}