- (void)rotateLabelDown {
// NSLog(@"rotateLabelDown");
// [UIView animateWithDuration:0.5
// delay:0
// options:UIViewAnimationOptionAllowUserInteraction
// animations:^{
//// label.transform = CGContextRotateCTM;
// label.transform = CGAffineTransformMakeRotation(M_PI);
// }
// completion:^(BOOL finished){
// [self rotateLabelUp];
// }
// ];
}
- (void)rotateLabelUp {
// NSLog(@"rotateLabelUp");
// [UIView animateWithDuration:0.5
// delay:0
// options:UIViewAnimationOptionAllowUserInteraction
// animations:^{
// label.transform = CGAffineTransformMakeRotation(0);
// }
// completion:^(BOOL finished){
// if (animate) {
// [self rotateLabelDown];
// }
// }
// ];
}
// NSLog(@"rotateLabelDown");
// [UIView animateWithDuration:0.5
// delay:0
// options:UIViewAnimationOptionAllowUserInteraction
// animations:^{
//// label.transform = CGContextRotateCTM;
// label.transform = CGAffineTransformMakeRotation(M_PI);
// }
// completion:^(BOOL finished){
// [self rotateLabelUp];
// }
// ];
}
- (void)rotateLabelUp {
// NSLog(@"rotateLabelUp");
// [UIView animateWithDuration:0.5
// delay:0
// options:UIViewAnimationOptionAllowUserInteraction
// animations:^{
// label.transform = CGAffineTransformMakeRotation(0);
// }
// completion:^(BOOL finished){
// if (animate) {
// [self rotateLabelDown];
// }
// }
// ];
}
旋转UILabel动画
本文介绍如何使用UIView动画方法实现UILabel的上下旋转效果。通过定义rotateLabelDown和rotateLabelUp两个方法,利用CGAffineTransformMakeRotation完成从下至上及从上至下的动画效果,并允许用户交互。
908

被折叠的 条评论
为什么被折叠?



