日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

IOS开发CAKeyframeAnimation的基本使用与keypath的列举

發布時間:2023/12/4 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 IOS开发CAKeyframeAnimation的基本使用与keypath的列举 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

2019獨角獸企業重金招聘Python工程師標準>>>

CAKeyframeAnimation跟CABasicAnimation的區別是:CABasicAnimation只能從一個數值(fromValue)變到另一個數值(toValue),而CAKeyframeAnimation會使用一個NSArray保存這些數值

-?(void)value {CAKeyframeAnimation?*anim?=?[CAKeyframeAnimation?animation];//?設置動畫屬性anim.keyPath?=?@"position";NSValue?*v1?=?[NSValue?valueWithCGPoint:CGPointZero];NSValue?*v2?=?[NSValue?valueWithCGPoint:CGPointMake(160,?160)];NSValue?*v3?=?[NSValue?valueWithCGPoint:CGPointMake(270,?0)];anim.values?=?@[v1,v2,v3];anim.duration?=?2;[_redView.layer?addAnimation:anim?forKey:nil]; } -(void)path {CAKeyframeAnimation?*anim?=?[CAKeyframeAnimation?animation];//?設置動畫屬性anim.keyPath?=?@"position";UIBezierPath?*path?=?[UIBezierPath?bezierPathWithOvalInRect:CGRectMake(0,?0,?200,?200)];anim.path?=?path.CGPath;anim.duration?=?0.25;//?取消反彈anim.removedOnCompletion?=?NO;anim.fillMode?=?kCAFillModeForwards;anim.repeatCount?=?MAXFLOAT;[_redView.layer?addAnimation:anim?forKey:nil]; } keyPath可以使用的key? #define?angle2Radian(angle)?((angle)/180.0*M_PI)?transform.rotation.x?圍繞x軸翻轉?參數:角度?angle2Radian(5)? transform.rotation.y?圍繞y軸翻轉?參數:同上? transform.rotation.z?圍繞z軸翻轉?參數:同上? transform.rotation?默認圍繞z軸? transform.scale.x?x方向縮放?參數:縮放比例?1.5? transform.scale.y?y方向縮放?參數:同上? transform.scale.z?z方向縮放?參數:同上? transform.scale?所有方向縮放?參數:同上? transform.translation.x?x方向移動?參數:x軸上的坐標?100? transform.translation.y?x方向移動?參數:y軸上的坐標? transform.translation.z?x方向移動?參數:z軸上的坐標? transform.translation?移動?參數:移動到的點?(100,100)? opacity?透明度?參數:透明度?0.5? backgroundColor?背景顏色?參數:顏色?(id)[[UIColor?redColor]?CGColor]? cornerRadius?圓角?參數:圓角半徑?5? borderWidth?邊框寬度?參數:邊框寬度?5? bounds?大小?參數:CGRect? contents?內容?參數:CGImage? contentsRect?可視內容?參數:CGRect?值是0~1之間的小數? hidden?是否隱藏? position? shadowColor? shadowOffset? shadowOpacity? shadowRadius


轉載于:https://my.oschina.net/u/2532565/blog/551227

總結

以上是生活随笔為你收集整理的IOS开发CAKeyframeAnimation的基本使用与keypath的列举的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。