刚开始使用核心图形。玩一个简单的按钮和标签。我希望此标签在每次单击按钮时旋转 180 度。它仅在第一次单击时动画(但是,控制台在每次单击时都会写入“DONE”)
- (IBAction)btnTest:(id)sender
{
[UIView animateWithDuration:1 delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^{
lblTest.layer.transform = CATransform3DMakeRotation(M_PI,0.0,1.0,0.0);
}completion:^(BOOL finished) {
if(finished)
NSLog(@"DONE");
}];
}