我的代码是这样的:
//  ViewController.m
//  核心动画
#import "ViewController.h"
@interface ViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *imageView;
@end
@implementation ViewController
- (void)viewDidLoad {
    [super viewDidLoad];
}
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    [UIView  animateWithDuration:3 animations:^{
self.imageView.layer.transform=CATransform3DMakeRotation(M_PI, 0, 1,1);
    }]; 
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}
@end
但是这样做旋转了一次就不在旋转了。请问如何实现不停的旋转呢?(按照Y轴)
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
LZ的代码,并不是按照Y找转,Y,Z同时都会动,按Y轴循环转动,有以下两种方法可供参考,推荐第一种方法,过渡更平滑,自然.
方法一:
方法二: