代码如下(截取):
- (IBAction)moveUp:(id)sender {//向上移动
[UIView animateWithDuration:0.5 animations:^{
self.imageV.transform = CGAffineTransformTranslate(self.imageV.transform, 0, -100);
}];
}
-
(IBAction)moveDown:(id)sender {//向下移动
[UIView animateWithDuration:0.5 animations:^{
self.imageV.transform = CGAffineTransformTranslate(self.imageV.transform, 0, 100);
}];
}
-
(IBAction)rotate:(id)sender {//旋转
[UIView animateWithDuration:0.5 animations:^{
self.imageV.transform = CGAffineTransformRotate(self.imageV.transform, M_PI_4);
}];
}
-
(IBAction)scale:(id)sender {//缩放
[UIView animateWithDuration:0.5 animations:^{
self.imageV.transform = CGAffineTransformScale(self.imageV.transform, 0.5, 0.5);
}];
}
使用这个按钮的时候,动作总是一闪一闪的,不知道为什么,求大神赐教~~~