例如,
CABasicAnimation *rotate = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
[rotate setToValue:@(M_PI)];
[rotate setDuration:0.1f];
[[aView layer] addAnimation:rotate forKey:@"myRotationAnimation"];
Run Code Online (Sandbox Code Playgroud)
在哪里M_PI定义为宏math.h,
#define M_PI 3.14159265358979323846264338327950288 /* pi */
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2603 次 |
| 最近记录: |