第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

如何實(shí)現(xiàn)圖片的3D旋轉(zhuǎn),而且是不停旋轉(zhuǎn)?

如何實(shí)現(xiàn)圖片的3D旋轉(zhuǎn),而且是不停旋轉(zhuǎn)?

牛魔王的故事 2019-04-19 16:29:44
我的代碼是這樣的://ViewController.m//核心動(dòng)畫(huà)#import"ViewController.h"@interfaceViewController()@property(weak,nonatomic)IBOutletUIImageView*imageView;@end@implementationViewController-(void)viewDidLoad{[superviewDidLoad];}-(void)touchesBegan:(NSSet*)toucheswithEvent:(UIEvent*)event{[UIViewanimateWithDuration:3animations:^{self.imageView.layer.transform=CATransform3DMakeRotation(M_PI,0,1,1);}];}-(void)didReceiveMemoryWarning{[superdidReceiveMemoryWarning];}@end但是這樣做旋轉(zhuǎn)了一次就不在旋轉(zhuǎn)了。請(qǐng)問(wèn)如何實(shí)現(xiàn)不停的旋轉(zhuǎn)呢?(按照Y軸)
查看完整描述

2 回答

?
慕哥6287543

TA貢獻(xiàn)1831條經(jīng)驗(yàn) 獲得超10個(gè)贊

[UIViewanimateWithDuration:3
delay:0
options:UIViewAnimationOptionRepeat
animations:^{
}
completion:^(BOOLfinished){
}];
                            
查看完整回答
反對(duì) 回復(fù) 2019-04-19
?
尚方寶劍之說(shuō)

TA貢獻(xiàn)1788條經(jīng)驗(yàn) 獲得超4個(gè)贊

LZ的代碼,并不是按照Y找轉(zhuǎn),Y,Z同時(shí)都會(huì)動(dòng),按Y軸循環(huán)轉(zhuǎn)動(dòng),有以下兩種方法可供參考,推薦第一種方法,過(guò)渡更平滑,自然.方法一:
CABasicAnimation*rotationAnimation;
rotationAnimation=[CABasicAnimationanimationWithKeyPath:@"transform.rotation.y"];
rotationAnimation.toValue=[NSNumbernumberWithFloat:M_PI*2.0];
rotationAnimation.duration=3;
rotationAnimation.cumulative=YES;
rotationAnimation.repeatCount=MAXFLOAT;
[self.imageView.layeraddAnimation:rotationAnimationforKey:@"rotationAnimation"];
方法二:
[UIViewanimateWithDuration:3
delay:0
options:UIViewAnimationOptionRepeat
animations:^{
self.imageView.layer.transform=CATransform3DMakeRotation(M_PI,0,1,0);
}
completion:^(BOOLfinished){
self.imageView.layer.transform=CATransform3DMakeRotation(M_PI,0,1,0);
}];
                            
查看完整回答
反對(duì) 回復(fù) 2019-04-19
  • 2 回答
  • 0 關(guān)注
  • 680 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)