{"id":108980,"date":"2026-09-23T04:40:44","date_gmt":"2026-09-22T20:40:44","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/108980.html"},"modified":"2026-09-23T04:40:44","modified_gmt":"2026-09-22T20:40:44","slug":"ios-cabasicanimation%e5%8a%a8%e7%94%bb","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/108980.html","title":{"rendered":"iOS: CABasicAnimation\u52a8\u753b"},"content":{"rendered":"<p>  \u4e2a\u4eba\u4e3b\u9875&#xff1a;<br \/>\n &gt; for_ever_love__ &lt; &#xff08;\u6b22\u8fce\u5404\u4f4d\u5927\u4f6c\u8385\u4e34&#x1f60a;&#xff09;<br \/>\n \u5176\u4ed6\u680f\u76ee:<br \/>\n&gt; \u6211\u60f3\u5b66python\u4e86 &lt; <\/p>\n<p>\u5176\u4ed6\u680f\u76ee: &gt; iOS\u9879\u76ee\u603b\u7ed3\u5927\u5168 &lt;<\/p>\n<p>\u5176\u4ed6\u680f\u76ee: &gt; iOS UI &lt;<\/p>\n<\/p>\n<h4>\u6587\u7ae0\u76ee\u5f55<\/h4>\n<ul>\n<li>CABasicAnimation<\/li>\n<li>\n<ul>\n<li>\u4e00\u3001Core Animation \u7684\u5206\u5c42<\/li>\n<li>\u4e8c\u3001\u52a8\u753b\u4f5c\u7528\u5728 CALayer \u4e0a&#xff0c;\u4e0d\u662f UIView<\/li>\n<li>\u4e09\u3001CABasicAnimation \u7684\u4e09\u4e2a\u6838\u5fc3\u8981\u7d20<\/li>\n<li>\n<ul>\n<li>1. keyPath \u2014\u2014 \u8981\u52a8\u753b\u7684\u5c5e\u6027<\/li>\n<li>2. fromValue \/ toValue \/ byValue \u2014\u2014 \u52a8\u753b\u7684\u8d77\u70b9\u7ec8\u70b9<\/li>\n<li>3. \u65f6\u957f\u4e0e\u63a7\u5236<\/li>\n<\/ul>\n<\/li>\n<li>\u56db\u3001\u628a\u52a8\u753b\u52a0\u5230 layer<\/li>\n<li>\u4e94\u3001\u52a8\u753b\u7684\u300c\u8868\u73b0\u5c42\u300d\u548c\u300c\u6a21\u578b\u5c42\u300d<\/li>\n<li>\n<ul>\n<li>\u6a21\u578b\u5c42&#xff08;Model Layer&#xff09;<\/li>\n<li>\u8868\u73b0\u5c42&#xff08;Presentation Layer&#xff09;<\/li>\n<li>\u5173\u952e\u89c4\u5219<\/li>\n<\/ul>\n<\/li>\n<li>\u516d\u3001\u5b8c\u6574\u793a\u4f8b&#xff1a;\u56db\u79cd\u5e38\u89c1\u52a8\u753b<\/li>\n<li>\n<ul>\n<li>1. \u6de1\u51fa<\/li>\n<li>2. \u7f29\u653e<\/li>\n<li>3. \u65cb\u8f6c&#xff08;\u4f60\u7684\u5c01\u9762&#xff09;<\/li>\n<li>4. \u6cbf X \u8f74\u5e73\u79fb<\/li>\n<\/ul>\n<\/li>\n<li>\u4e03\u3001CABasicAnimation \u7684\u5c40\u9650<\/li>\n<li>\u516b\u3001\u6027\u80fd\u4e0e\u6ce8\u610f\u4e8b\u9879<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>CABasicAnimation<\/h2>\n<p>CABasicAnimation \u662f Core Animation \u6846\u67b6\u91cc\u6700\u57fa\u7840\u3001\u6700\u5e38\u7528\u7684\u52a8\u753b\u7c7b&#xff0c;\u7528\u6765\u505a\u300c\u67d0\u4e2a\u5c5e\u6027\u4ece\u4e00\u4e2a\u503c\u5e73\u6ed1\u53d8\u5316\u5230\u53e6\u4e00\u4e2a\u503c\u300d\u7684\u8865\u95f4\u52a8\u753b\u3002\u4f60\u9879\u76ee\u91cc\u5c01\u9762\u65cb\u8f6c\u5c31\u662f\u5b83\u3002\u4e0b\u9762\u4ece\u6982\u5ff5\u5230\u5b9e\u6218\u7cfb\u7edf\u8bb2\u4e00\u904d\u3002<\/p>\n<h3>\u4e00\u3001Core Animation \u7684\u5206\u5c42<\/h3>\n<p>\u5148\u5efa\u7acb\u6574\u4f53\u56fe\u666f\u3002iOS \u52a8\u753b\u5206\u51e0\u5c42&#xff1a;<\/p>\n<p>text<\/p>\n<p>UIKit \u5c42    UIView animateWithDuration:        \u2190 \u6700\u7b80\u5355&#xff0c;\u505a\u4e00\u6b21\u6027\u52a8\u753b<br \/>\n              \u2193&#xff08;\u5e95\u5c42\u8f6c\u6210&#xff09;<br \/>\nCore Animation \u5c42<br \/>\n    \u251c\u2500\u2500 CAAnimation&#xff08;\u62bd\u8c61\u57fa\u7c7b&#xff09;<br \/>\n    \u2502     \u251c\u2500\u2500 CAPropertyAnimation&#xff08;\u62bd\u8c61&#xff09;<br \/>\n    \u2502     \u2502     \u251c\u2500\u2500 CABasicAnimation      \u2190 \u4ece A \u5230 B<br \/>\n    \u2502     \u2502     \u2514\u2500\u2500 CAKeyframeAnimation   \u2190 \u6cbf\u8def\u5f84\/\u591a\u4e2a\u5173\u952e\u70b9<br \/>\n    \u2502     \u251c\u2500\u2500 CAAnimationGroup            \u2190 \u591a\u4e2a\u52a8\u753b\u7ec4\u5408<br \/>\n    \u2502     \u2514\u2500\u2500 CATransition                \u2190 \u8f6c\u573a\u52a8\u753b<br \/>\n    \u2514\u2500\u2500 CALayer                            \u2190 \u52a8\u753b\u4f5c\u7528\u7684\u8f7d\u4f53<\/p>\n<p>\u5173\u952e\u8ba4\u77e5&#xff1a;UIKit \u7684\u52a8\u753b API \u662f Core Animation \u7684\u5c01\u88c5\u3002\u60f3\u505a\u65e0\u9650\u5faa\u73af\u3001\u7cbe\u786e\u63a7\u5236\u7f13\u52a8\u3001\u7ec4\u5408\u52a8\u753b&#xff0c;\u5c31\u5f97\u76f4\u63a5\u4e0b\u5230 Core Animation \u5c42\u7528 CABasicAnimation\u3002<\/p>\n<h3>\u4e8c\u3001\u52a8\u753b\u4f5c\u7528\u5728 CALayer \u4e0a&#xff0c;\u4e0d\u662f UIView<\/h3>\n<p>UIView \u548c CALayer \u662f\u300c\u4e00\u4e2a\u89c6\u56fe\u4e24\u5c42\u300d&#xff1a;<\/p>\n<ul>\n<li>UIView&#xff1a;\u8d1f\u8d23\u54cd\u5e94\u4e8b\u4ef6\u3001\u5904\u7406\u89e6\u6478\u3001\u5e03\u5c40<\/li>\n<li>CALayer&#xff1a;\u8d1f\u8d23\u7ed8\u5236\u548c\u52a8\u753b<\/li>\n<\/ul>\n<p>\u6bcf\u4e2a UIView \u80cc\u540e\u90fd\u6709\u4e00\u4e2a layer&#xff08;view.layer&#xff09;\u3002\u6240\u6709 Core Animation \u7684\u52a8\u753b\u90fd\u662f\u52a0\u5230 layer \u4e0a\u7684&#xff1a;<\/p>\n<p>objc<\/p>\n<p>[self.coverImageView.layer addAnimation:rotation forKey:&#064;&#034;coverRotation&#034;];<br \/>\n\/\/                    \u2191 \u6ce8\u610f\u662f layer&#xff0c;\u4e0d\u662f view<\/p>\n<p>\u4e3a\u4ec0\u4e48\u8981\u5206\u4e24\u5c42&#xff1a;layer \u66f4\u8f7b\u91cf&#xff0c;\u53ef\u4ee5\u5728\u6ca1\u6709 UIView \u7684\u60c5\u51b5\u4e0b\u72ec\u7acb\u5b58\u5728&#xff08;\u6bd4\u5982 CALayer \u53ef\u4ee5\u5355\u72ec\u505a\u7c92\u5b50\u6548\u679c&#xff09;&#xff0c;\u52a8\u753b\u6027\u80fd\u4e5f\u66f4\u597d\u3002<\/p>\n<h3>\u4e09\u3001CABasicAnimation \u7684\u4e09\u4e2a\u6838\u5fc3\u8981\u7d20<\/h3>\n<p>\u4e00\u4e2a CABasicAnimation \u56de\u7b54\u4e09\u4e2a\u95ee\u9898&#xff1a;<\/p>\n<table>\n<tr>\u95ee\u9898\u5bf9\u5e94\u5c5e\u6027<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">\u6539\u54ea\u4e2a\u5c5e\u6027&#xff1f;<\/td>\n<td align=\"left\">keyPath<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u4ece\u54ea\u5230\u54ea&#xff1f;<\/td>\n<td align=\"left\">fromValue \/ toValue&#xff08;\u6216 byValue&#xff09;<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u600e\u4e48\u53d8&#xff1f;<\/td>\n<td align=\"left\">duration \/ repeatCount \/ timingFunction \u7b49<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>1. keyPath \u2014\u2014 \u8981\u52a8\u753b\u7684\u5c5e\u6027<\/h4>\n<p>objc<\/p>\n<p>CABasicAnimation *anim &#061; [CABasicAnimation animationWithKeyPath:&#064;&#034;transform.rotation.z&#034;];<\/p>\n<p>keyPath \u662f\u5b57\u7b26\u4e32&#xff0c;\u6307\u5411 layer \u4e0a\u67d0\u4e2a\u53ef\u52a8\u753b\u7684\u5c5e\u6027\u3002\u5e38\u7528\u7684&#xff1a;<\/p>\n<table>\n<tr>keyPath\u542b\u4e49\u6548\u679c<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">position<\/td>\n<td align=\"left\">\u4f4d\u7f6e<\/td>\n<td align=\"left\">\u79fb\u52a8<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">position.x \/ position.y<\/td>\n<td align=\"left\">\u5355\u8f74\u4f4d\u7f6e<\/td>\n<td align=\"left\">\u5355\u65b9\u5411\u79fb\u52a8<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">opacity<\/td>\n<td align=\"left\">\u900f\u660e\u5ea6<\/td>\n<td align=\"left\">\u6de1\u5165\u6de1\u51fa<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">bounds.size<\/td>\n<td align=\"left\">\u5c3a\u5bf8<\/td>\n<td align=\"left\">\u7f29\u653e&#xff08;\u6539\u5c3a\u5bf8&#xff09;<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">transform.scale<\/td>\n<td align=\"left\">\u7f29\u653e<\/td>\n<td align=\"left\">\u7f29\u653e<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">transform.scale.x<\/td>\n<td align=\"left\">X \u8f74\u7f29\u653e<\/td>\n<td align=\"left\">\u6a2a\u5411\u7f29\u653e<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">transform.rotation<\/td>\n<td align=\"left\">\u65cb\u8f6c<\/td>\n<td align=\"left\">\u65cb\u8f6c<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">transform.rotation.z<\/td>\n<td align=\"left\">\u7ed5 Z \u8f74\u65cb\u8f6c<\/td>\n<td align=\"left\">\u5c4f\u5e55\u5e73\u9762\u5185\u65cb\u8f6c&#xff08;\u4f60\u7684\u5c01\u9762&#xff09;<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">transform.rotation.x<\/td>\n<td align=\"left\">\u7ed5 X \u8f74\u65cb\u8f6c<\/td>\n<td align=\"left\">\u4e0a\u4e0b\u7ffb\u8f6c<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">backgroundColor<\/td>\n<td align=\"left\">\u80cc\u666f\u8272<\/td>\n<td align=\"left\">\u989c\u8272\u6e10\u53d8<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">cornerRadius<\/td>\n<td align=\"left\">\u5706\u89d2<\/td>\n<td align=\"left\">\u5706\u89d2\u53d8\u5316<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">borderWidth<\/td>\n<td align=\"left\">\u8fb9\u6846\u5bbd\u5ea6<\/td>\n<td align=\"left\">\u8fb9\u6846\u53d8\u5316<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6ce8\u610f keyPath \u652f\u6301\u70b9\u8bed\u6cd5&#xff0c;\u53ef\u4ee5\u7cbe\u786e\u5230\u5b50\u5c5e\u6027&#xff1a;<\/p>\n<p>objc<\/p>\n<p>&#064;&#034;position&#034;              \/\/ \u6574\u4e2a position<br \/>\n&#064;&#034;position.x&#034;            \/\/ \u53ea\u52a8 x<br \/>\n&#064;&#034;transform.rotation.z&#034;  \/\/ \u53ea\u7ed5 z \u8f6c<br \/>\n&#064;&#034;bounds.size.width&#034;     \/\/ \u53ea\u6539\u5bbd\u5ea6<\/p>\n<p>\u5173\u952e&#xff1a;\u4e0d\u662f\u6240\u6709\u5c5e\u6027\u90fd\u80fd\u52a8\u753b\u3002layer \u4e0a\u300c\u53ef\u52a8\u753b\u5c5e\u6027\u300d\u6709\u660e\u786e\u6e05\u5355&#xff0c;\u5199\u9519\u4e86\u4f1a\u8fd0\u884c\u65f6\u5d29\u6e83&#xff08;\u62a5 NSUnknownKeyException&#xff09;\u3002\u5e38\u89c1\u7684\u5c31\u662f\u4e0a\u9762\u8868\u91cc\u90a3\u4e9b\u3002<\/p>\n<h4>2. fromValue \/ toValue \/ byValue \u2014\u2014 \u52a8\u753b\u7684\u8d77\u70b9\u7ec8\u70b9<\/h4>\n<p>\u4e09\u79cd\u7ec4\u5408\u65b9\u5f0f&#xff1a;<\/p>\n<p>objc<\/p>\n<p>\/\/ \u65b9\u5f0f 1&#xff1a;\u4ece A \u5230 B&#xff08;\u6700\u5e38\u7528&#xff09;<br \/>\nanim.fromValue &#061; &#064;0;<br \/>\nanim.toValue &#061; &#064;(M_PI * 2);<\/p>\n<p>\/\/ \u65b9\u5f0f 2&#xff1a;\u4ece\u5f53\u524d\u503c\u53d8\u5316 delta&#xff08;\u76f8\u5bf9\u52a8\u753b&#xff09;<br \/>\nanim.byValue &#061; &#064;100;   \/\/ \u5728\u5f53\u524d\u503c\u57fa\u7840\u4e0a &#043;100<\/p>\n<p>\/\/ \u65b9\u5f0f 3&#xff1a;\u53ea\u7ed9 toValue&#xff0c;fromValue \u53d6\u5f53\u524d\u503c<br \/>\nanim.toValue &#061; &#064;1.0;   \/\/ \u4ece\u5f53\u524d\u503c\u53d8\u5230 1.0<\/p>\n<p>\u91cd\u8981\u6982\u5ff5&#xff1a;fromValue \/ toValue \u662f id \u7c7b\u578b&#xff0c;\u6240\u4ee5\u8981\u88c5\u7bb1&#xff1a;<\/p>\n<p>objc<\/p>\n<p>&#064;0              \/\/ NSNumber&#xff0c;int<br \/>\n&#064;(M_PI * 2)     \/\/ NSNumber&#xff0c;double<br \/>\n&#064;(YES)          \/\/ NSNumber&#xff0c;BOOL<br \/>\n[UIColor redColor]   \/\/ \u989c\u8272\u76f4\u63a5\u662f\u5bf9\u8c61<br \/>\n[NSValue valueWithCGPoint:&#8230;]  \/\/ \u7ed3\u6784\u4f53\u7528 NSValue \u5305<\/p>\n<p>\u57fa\u672c\u7c7b\u578b\u7528 &#064;() \u88c5\u7bb1&#xff0c;\u5bf9\u8c61\u7c7b\u578b\u76f4\u63a5\u7528\u3002<\/p>\n<h4>3. \u65f6\u957f\u4e0e\u63a7\u5236<\/h4>\n<p>objc<\/p>\n<p>anim.duration &#061; 20.0;                    \/\/ \u4e00\u6b21\u52a8\u753b\u6301\u7eed 20 \u79d2<br \/>\nanim.repeatCount &#061; HUGE_VALF;            \/\/ \u65e0\u9650\u91cd\u590d<br \/>\nanim.timingFunction &#061; [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];<br \/>\nanim.autoreverses &#061; YES;                 \/\/ \u5230\u8fbe\u7ec8\u70b9\u540e\u53cd\u5411\u56de\u5230\u8d77\u70b9<br \/>\nanim.beginTime &#061; CACurrentMediaTime() &#043; 1.0;  \/\/ \u5ef6\u8fdf 1 \u79d2\u5f00\u59cb<br \/>\nanim.speed &#061; 2.0;                        \/\/ 2 \u500d\u901f<\/p>\n<p>\u5e38\u7528\u63a7\u5236\u5c5e\u6027&#xff1a;<\/p>\n<table>\n<tr>\u5c5e\u6027\u4f5c\u7528<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">duration<\/td>\n<td align=\"left\">\u4e00\u6b21\u5b8c\u6574\u52a8\u753b\u7684\u65f6\u957f&#xff08;\u79d2&#xff09;<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">repeatCount<\/td>\n<td align=\"left\">\u91cd\u590d\u6b21\u6570&#xff0c;HUGE_VALF \u662f\u65e0\u9650<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">repeatDuration<\/td>\n<td align=\"left\">\u91cd\u590d\u7684\u603b\u65f6\u957f<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">autoreverses<\/td>\n<td align=\"left\">\u5230\u7ec8\u70b9\u540e\u662f\u5426\u53cd\u5411<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">timingFunction<\/td>\n<td align=\"left\">\u7f13\u52a8\u66f2\u7ebf&#xff08;\u5300\u901f\u3001\u52a0\u901f\u3001\u51cf\u901f\u7b49&#xff09;<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">beginTime<\/td>\n<td align=\"left\">\u5ef6\u8fdf\u5f00\u59cb\u65f6\u95f4<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">speed<\/td>\n<td align=\"left\">\u52a8\u753b\u901f\u5ea6\u500d\u7387<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u7f13\u52a8\u66f2\u7ebf&#xff08;timingFunction&#xff09;&#xff1a;<\/p>\n<table>\n<tr>\u5e38\u91cf\u6548\u679c<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">kCAMediaTimingFunctionLinear<\/td>\n<td align=\"left\">\u5300\u901f<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">kCAMediaTimingFunctionEaseIn<\/td>\n<td align=\"left\">\u6162\u8fdb\u5feb\u51fa&#xff08;\u52a0\u901f&#xff09;<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">kCAMediaTimingFunctionEaseOut<\/td>\n<td align=\"left\">\u5feb\u8fdb\u6162\u51fa&#xff08;\u51cf\u901f&#xff09;<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">kCAMediaTimingFunctionEaseInEaseOut<\/td>\n<td align=\"left\">\u6162\u8fdb\u6162\u51fa<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">kCAMediaTimingFunctionDefault<\/td>\n<td align=\"left\">\u9ed8\u8ba4&#xff08;\u7c7b\u4f3c EaseInEaseOut&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u56db\u3001\u628a\u52a8\u753b\u52a0\u5230 layer<\/h3>\n<p>objc<\/p>\n<p>[layer addAnimation:anim forKey:&#064;&#034;someKey&#034;];<\/p>\n<p>forKey: \u662f\u52a8\u753b\u7684\u6807\u8bc6&#xff0c;\u4e0d\u662f keyPath\u3002\u4f5c\u7528\u662f&#xff1a;<\/p>\n<li>\u67e5\u8be2&#xff1a;[layer animationForKey:&#064;&#034;someKey&#034;] \u62ff\u5230\u8fd9\u4e2a\u52a8\u753b<\/li>\n<li>\u79fb\u9664&#xff1a;[layer removeAnimationForKey:&#064;&#034;someKey&#034;] \u79fb\u9664<\/li>\n<li>\u66ff\u6362&#xff1a;\u540c\u4e00\u4e2a key \u518d\u52a0\u52a8\u753b\u4f1a\u66ff\u6362\u65e7\u7684<\/li>\n<li>\u53bb\u91cd&#xff1a;\u7528 key \u5224\u65ad\u662f\u5426\u5df2\u6dfb\u52a0<\/li>\n<p>key \u53ef\u4ee5\u4e3a nil&#xff0c;\u4f46\u90a3\u6837\u5c31\u65e0\u6cd5\u67e5\u8be2\u548c\u7cbe\u786e\u79fb\u9664\u4e86&#xff0c;\u4e0d\u63a8\u8350\u3002<\/p>\n<h3>\u4e94\u3001\u52a8\u753b\u7684\u300c\u8868\u73b0\u5c42\u300d\u548c\u300c\u6a21\u578b\u5c42\u300d<\/h3>\n<p>\u8fd9\u662f Core Animation \u6700\u91cd\u8981\u3001\u6700\u5bb9\u6613\u8e29\u5751\u7684\u6982\u5ff5\u3002<\/p>\n<h4>\u6a21\u578b\u5c42&#xff08;Model Layer&#xff09;<\/h4>\n<p>\u4f60\u76f4\u63a5\u8bfb\u5199\u7684\u5c5e\u6027&#xff1a;<\/p>\n<p>objc<\/p>\n<p>layer.position      \/\/ \u8bfb\u5230\u7684\u6c38\u8fdc\u662f\u300c\u771f\u5b9e\u300d\u503c<br \/>\nlayer.transform<br \/>\nlayer.opacity<\/p>\n<h4>\u8868\u73b0\u5c42&#xff08;Presentation Layer&#xff09;<\/h4>\n<p>\u5c4f\u5e55\u4e0a\u5b9e\u9645\u663e\u793a\u7684\u5c5e\u6027&#xff1a;<\/p>\n<p>objc<\/p>\n<p>layer.presentationLayer.position   \/\/ \u52a8\u753b\u8fdb\u884c\u4e2d\u7684\u300c\u5f53\u524d\u663e\u793a\u503c\u300d<\/p>\n<h4>\u5173\u952e\u89c4\u5219<\/h4>\n<p>\u52a8\u753b\u64ad\u653e\u65f6&#xff0c;\u6a21\u578b\u5c42\u7684\u503c\u4e0d\u53d8&#xff0c;\u53ea\u6709\u8868\u73b0\u5c42\u5728\u53d8\u3002<\/p>\n<p>objc<\/p>\n<p>CABasicAnimation *anim &#061; [CABasicAnimation animationWithKeyPath:&#064;&#034;opacity&#034;];<br \/>\nanim.fromValue &#061; &#064;1.0;<br \/>\nanim.toValue &#061; &#064;0.0;<br \/>\nanim.duration &#061; 2.0;<br \/>\n[layer addAnimation:anim forKey:&#064;&#034;fade&#034;];<\/p>\n<p>\/\/ \u52a8\u753b\u8fdb\u884c\u4e2d&#xff1a;<br \/>\nlayer.opacity                  \/\/ \u8fd8\u662f 1.0&#xff08;\u6a21\u578b\u5c42\u6ca1\u53d8&#xff09;<br \/>\nlayer.presentationLayer.opacity \/\/ 0.5 \u5de6\u53f3&#xff08;\u8868\u73b0\u5c42\u5728\u53d8&#xff09;<\/p>\n<p>\/\/ \u52a8\u753b\u7ed3\u675f\u540e&#xff1a;<br \/>\nlayer.opacity                  \/\/ \u8fd8\u662f 1.0&#xff01;\u8df3\u56de\u539f\u503c<\/p>\n<p>\u52a8\u753b\u7ed3\u675f\u540e&#xff0c;layer \u7acb\u5373\u300c\u8df3\u56de\u300d\u5230\u6a21\u578b\u5c42\u7684\u503c\u3002 \u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48&#xff1a;<\/p>\n<ul>\n<li>\u4f60\u7684\u5c01\u9762\u505c\u6b62\u65cb\u8f6c\u65f6&#xff0c;\u7acb\u5373\u56de\u5230\u672a\u65cb\u8f6c\u72b6\u6001&#xff08;\u6a21\u578b\u5c42 transform \u4ece\u6ca1\u53d8\u8fc7&#xff09;<\/li>\n<li>\u5982\u679c\u4f60\u60f3\u8ba9 layer \u505c\u7559\u5728\u7ec8\u70b9&#xff0c;\u5fc5\u987b\u540c\u65f6\u4fee\u6539\u6a21\u578b\u5c42&#xff1a;<\/li>\n<\/ul>\n<p>objc<\/p>\n<p>\/\/ \u52a8\u753b\u7ed3\u675f\u540e\u505c\u7559\u5728\u7ec8\u70b9<br \/>\nanim.fromValue &#061; &#064;1.0;<br \/>\nanim.toValue &#061; &#064;0.0;<br \/>\nanim.removedOnCompletion &#061; NO;      \/\/ \u52a8\u753b\u7ed3\u675f\u540e\u4e0d\u79fb\u9664<br \/>\nanim.fillMode &#061; kCAFillModeForwards; \/\/ \u4fdd\u6301\u7ec8\u70b9\u72b6\u6001<br \/>\n[layer addAnimation:anim forKey:&#064;&#034;fade&#034;];<\/p>\n<p>\/\/ \u4f46\u8fd9\u53ea\u6539\u4e86\u8868\u73b0\u5c42&#xff0c;\u6a21\u578b\u5c42\u8fd8\u662f 1.0<br \/>\n\/\/ \u6b63\u786e\u505a\u6cd5&#xff1a;\u52a8\u753b\u7ed3\u675f\u540e\u624b\u52a8\u6539\u6a21\u578b\u5c42<br \/>\nlayer.opacity &#061; 0.0;<\/p>\n<p>\u5bf9\u4f60\u7684\u5c01\u9762\u65cb\u8f6c&#xff1a;\u56e0\u4e3a\u52a8\u753b\u662f\u65e0\u9650\u5faa\u73af&#xff0c;\u505c\u6b62\u65f6\u56de\u5230\u539f\u4f4d\u6b63\u662f\u60f3\u8981\u7684\u6548\u679c&#xff0c;\u6240\u4ee5\u4e0d\u9700\u8981\u5904\u7406\u6a21\u578b\u5c42\u3002\u8fd9\u662f\u7b80\u5316&#xff0c;\u4e0d\u662f bug\u3002<\/p>\n<h3>\u516d\u3001\u5b8c\u6574\u793a\u4f8b&#xff1a;\u56db\u79cd\u5e38\u89c1\u52a8\u753b<\/h3>\n<h4>1. \u6de1\u51fa<\/h4>\n<p>objc<\/p>\n<p>CABasicAnimation *fade &#061; [CABasicAnimation animationWithKeyPath:&#064;&#034;opacity&#034;];<br \/>\nfade.fromValue &#061; &#064;1.0;<br \/>\nfade.toValue &#061; &#064;0.0;<br \/>\nfade.duration &#061; 0.3;<br \/>\nfade.timingFunction &#061; [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];<br \/>\n[layer addAnimation:fade forKey:&#064;&#034;fadeOut&#034;];<br \/>\nlayer.opacity &#061; 0.0;   \/\/ \u540c\u65f6\u6539\u6a21\u578b\u5c42&#xff0c;\u52a8\u753b\u7ed3\u675f\u540e\u4fdd\u6301<\/p>\n<h4>2. \u7f29\u653e<\/h4>\n<p>objc<\/p>\n<p>CABasicAnimation *scale &#061; [CABasicAnimation animationWithKeyPath:&#064;&#034;transform.scale&#034;];<br \/>\nscale.fromValue &#061; &#064;1.0;<br \/>\nscale.toValue &#061; &#064;1.5;<br \/>\nscale.duration &#061; 0.2;<br \/>\nscale.autoreverses &#061; YES;   \/\/ \u653e\u5927\u540e\u81ea\u52a8\u7f29\u56de<br \/>\n[layer addAnimation:scale forKey:&#064;&#034;pulse&#034;];<\/p>\n<h4>3. \u65cb\u8f6c&#xff08;\u4f60\u7684\u5c01\u9762&#xff09;<\/h4>\n<p>objc<\/p>\n<p>CABasicAnimation *rotation &#061; [CABasicAnimation animationWithKeyPath:&#064;&#034;transform.rotation.z&#034;];<br \/>\nrotation.fromValue &#061; &#064;0;<br \/>\nrotation.toValue &#061; &#064;(M_PI * 2);<br \/>\nrotation.duration &#061; 20.0;<br \/>\nrotation.repeatCount &#061; HUGE_VALF;<br \/>\nrotation.timingFunction &#061; [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; \/\/ \u5300\u901f<br \/>\n[layer addAnimation:rotation forKey:&#064;&#034;coverRotation&#034;];<\/p>\n<p>\u6ce8\u610f&#xff1a;\u4f60\u7684\u539f\u4ee3\u7801\u6ca1\u8bbe timingFunction&#xff0c;\u9ed8\u8ba4\u662f kCAMediaTimingFunctionDefault&#xff08;\u7f13\u5165\u7f13\u51fa&#xff09;&#xff0c;\u8fd9\u610f\u5473\u7740\u6bcf\u5708\u5f00\u5934\u548c\u7ed3\u5c3e\u4f1a\u51cf\u901f\u518d\u52a0\u901f&#xff0c;\u8f6c\u8d77\u6765\u4e0d\u662f\u5300\u901f\u7684&#xff0c;\u89c6\u89c9\u4e0a\u4f1a\u300c\u4e00\u987f\u4e00\u987f\u300d\u3002\u5982\u679c\u4f60\u60f3\u8981\u5300\u901f\u65cb\u8f6c&#xff0c;\u5e94\u8be5\u663e\u5f0f\u8bbe kCAMediaTimingFunctionLinear\u3002\u8fd9\u662f\u4e2a\u53ef\u4ee5\u4f18\u5316\u7684\u5c0f\u70b9\u3002<\/p>\n<h4>4. \u6cbf X \u8f74\u5e73\u79fb<\/h4>\n<p>objc<\/p>\n<p>CABasicAnimation *move &#061; [CABasicAnimation animationWithKeyPath:&#064;&#034;position.x&#034;];<br \/>\nmove.fromValue &#061; &#064;(layer.position.x);<br \/>\nmove.toValue &#061; &#064;(layer.position.x &#043; 100);<br \/>\nmove.duration &#061; 0.5;<br \/>\n[layer addAnimation:move forKey:&#064;&#034;moveRight&#034;];<\/p>\n<h3>\u4e03\u3001CABasicAnimation \u7684\u5c40\u9650<\/h3>\n<p>CABasicAnimation \u53ea\u80fd\u505a\u4e24\u4e2a\u503c\u4e4b\u95f4\u7684\u76f4\u7ebf\u63d2\u503c\u3002\u4ee5\u4e0b\u573a\u666f\u5b83\u505a\u4e0d\u4e86&#xff1a;<\/p>\n<table>\n<tr>\u9700\u6c42\u7528\u4ec0\u4e48<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">\u6cbf\u66f2\u7ebf\/\u8def\u5f84\u79fb\u52a8<\/td>\n<td align=\"left\">CAKeyframeAnimation&#xff08;\u914d path&#xff09;<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u591a\u4e2a\u5173\u952e\u70b9\u7684\u590d\u6742\u52a8\u753b<\/td>\n<td align=\"left\">CAKeyframeAnimation<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u591a\u4e2a\u52a8\u753b\u540c\u65f6\/\u987a\u5e8f\u64ad\u653e<\/td>\n<td align=\"left\">CAAnimationGroup<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u89c6\u56fe\u63a7\u5236\u5668\u8f6c\u573a<\/td>\n<td align=\"left\">CATransition \u6216\u81ea\u5b9a\u4e49\u8f6c\u573a<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u7269\u7406\u6548\u679c&#xff08;\u5f39\u7c27\u3001\u91cd\u529b&#xff09;<\/td>\n<td align=\"left\">UIAttachmentBehavior \u7b49 UIKit Dynamics<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u4ea4\u4e92\u5f0f\u52a8\u753b&#xff08;\u53ef\u4e2d\u65ad\u3001\u53ef\u53cd\u5411&#xff09;<\/td>\n<td align=\"left\">UIViewPropertyAnimator&#xff08;iOS 10&#043;&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>CAKeyframeAnimation \u793a\u4f8b&#xff08;\u6cbf\u8def\u5f84\u79fb\u52a8&#xff09;&#xff1a;<\/p>\n<p>objc<\/p>\n<p>CAKeyframeAnimation *anim &#061; [CAKeyframeAnimation animationWithKeyPath:&#064;&#034;position&#034;];<br \/>\nUIBezierPath *path &#061; [UIBezierPath bezierPathWithArcCenter:&#8230;];<br \/>\nanim.path &#061; path.CGPath;<br \/>\nanim.duration &#061; 2.0;<br \/>\n[layer addAnimation:anim forKey:&#064;&#034;moveAlongPath&#034;];<\/p>\n<h3>\u516b\u3001\u6027\u80fd\u4e0e\u6ce8\u610f\u4e8b\u9879<\/h3>\n<p>1. \u5c3d\u91cf\u7528 transform&#xff0c;\u522b\u7528 frame \/ bounds<\/p>\n<p>transform \u52a8\u753b\u7531 GPU \u5904\u7406&#xff0c;\u6027\u80fd\u597d&#xff1b;\u6539 frame \/ bounds \u4f1a\u89e6\u53d1\u91cd\u65b0\u5e03\u5c40&#xff0c;\u6027\u80fd\u5dee\u3002<\/p>\n<p>2. \u52a8\u753b\u7684 key \u8981\u552f\u4e00\u4e14\u8bed\u4e49\u5316<\/p>\n<p>\u7528 static NSString * const kCoverRotationKey &#061; &#064;&#034;coverRotation&#034;; \u800c\u4e0d\u662f\u88f8\u5b57\u7b26\u4e32&#xff0c;\u907f\u514d\u51b2\u7a81\u548c\u624b\u8bef\u3002<\/p>\n<p>3. \u79fb\u9664\u52a8\u753b\u540e\u6a21\u578b\u5c42\u4e0d\u53d8<\/p>\n<p>\u5982\u679c\u52a8\u753b\u662f\u300c\u4e00\u6b21\u6027\u300d\u7684&#xff08;\u6bd4\u5982\u6de1\u51fa&#xff09;&#xff0c;\u8bb0\u5f97\u540c\u65f6\u6539\u6a21\u578b\u5c42&#xff0c;\u5426\u5219\u79fb\u9664\u52a8\u753b\u540e\u4f1a\u8df3\u56de\u3002<\/p>\n<p>4. \u89c6\u56fe\u9500\u6bc1\u65f6\u52a8\u753b\u81ea\u52a8\u505c\u6b62<\/p>\n<p>\u52a8\u753b\u52a0\u5728 layer \u4e0a&#xff0c;view \u88ab\u91ca\u653e\u65f6 layer \u4e5f\u91ca\u653e&#xff0c;\u52a8\u753b\u81ea\u7136\u505c\u6b62\u3002\u4f46\u5982\u679c view \u8fd8\u5728\u4f46\u4e0d\u518d\u9700\u8981\u52a8\u753b&#xff0c;\u8981\u624b\u52a8 removeAnimationForKey:\u3002<\/p>\n<p>5. removedOnCompletion \u9ed8\u8ba4\u662f YES<\/p>\n<p>\u52a8\u753b\u64ad\u5b8c\u81ea\u52a8\u79fb\u9664\u3002\u5982\u679c\u8bbe\u6210 NO&#xff0c;\u52a8\u753b\u4f1a\u4e00\u76f4\u7559\u5728 layer \u4e0a&#xff08;\u4f46\u4e0d\u518d\u64ad\u653e&#xff09;&#xff0c;\u914d\u5408 fillMode &#061; kCAFillModeForwards \u53ef\u4ee5\u300c\u4fdd\u6301\u7ec8\u70b9\u72b6\u6001\u300d\u3002<\/p>\n<p>6. \u4e0d\u8981\u5728 layoutSubviews \u91cc\u52a0\u52a8\u753b<\/p>\n<p>layoutSubviews \u4f1a\u591a\u6b21\u8c03\u7528&#xff0c;\u6bcf\u6b21\u90fd\u52a0\u52a8\u753b\u4f1a\u53e0\u52a0\u3002\u5e94\u8be5\u5728\u5176\u4ed6\u65f6\u673a\u52a0&#xff0c;\u6216\u8005\u5728 layoutSubviews \u91cc\u7528 key \u68c0\u67e5\u907f\u514d\u91cd\u590d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e2a\u4eba\u4e3b\u9875&#xff1a;&gt; for_ever_love__  \u6211\u60f3\u5b66python\u4e86  iOS\u9879\u76ee\u603b\u7ed3\u5927\u5168  iOS UI &lt; \u6587\u7ae0\u76ee\u5f55CABasicAnimation\u4e00\u3001Core Animation \u7684\u5206\u5c42\u4e8c\u3001\u52a8\u753b\u4f5c\u7528\u5728 CALayer \u4e0a&#xff0c;\u4e0d\u662f UIView\u4e09\u3001CABasicAnimation \u7684\u4e09\u4e2a\u6838\u5fc3\u8981\u7d201. keyPath \u2014\u2014<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[6356,4027,1680,371],"topic":[],"class_list":["post-108980","post","type-post","status-publish","format-standard","hentry","category-server","tag-6356","tag-cocoa","tag-ios","tag-371"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>iOS: CABasicAnimation\u52a8\u753b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/108980.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"iOS: CABasicAnimation\u52a8\u753b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e2a\u4eba\u4e3b\u9875&#xff1a;&gt; for_ever_love__ \u6211\u60f3\u5b66python\u4e86 iOS\u9879\u76ee\u603b\u7ed3\u5927\u5168 iOS UI &lt; \u6587\u7ae0\u76ee\u5f55CABasicAnimation\u4e00\u3001Core Animation \u7684\u5206\u5c42\u4e8c\u3001\u52a8\u753b\u4f5c\u7528\u5728 CALayer \u4e0a&#xff0c;\u4e0d\u662f UIView\u4e09\u3001CABasicAnimation \u7684\u4e09\u4e2a\u6838\u5fc3\u8981\u7d201. keyPath \u2014\u2014\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/108980.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-22T20:40:44+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/108980.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/108980.html\",\"name\":\"iOS: CABasicAnimation\u52a8\u753b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-22T20:40:44+00:00\",\"dateModified\":\"2026-09-22T20:40:44+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/108980.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/108980.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/108980.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"iOS: CABasicAnimation\u52a8\u753b\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"iOS: CABasicAnimation\u52a8\u753b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/108980.html","og_locale":"zh_CN","og_type":"article","og_title":"iOS: CABasicAnimation\u52a8\u753b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e2a\u4eba\u4e3b\u9875&#xff1a;&gt; for_ever_love__ \u6211\u60f3\u5b66python\u4e86 iOS\u9879\u76ee\u603b\u7ed3\u5927\u5168 iOS UI &lt; \u6587\u7ae0\u76ee\u5f55CABasicAnimation\u4e00\u3001Core Animation \u7684\u5206\u5c42\u4e8c\u3001\u52a8\u753b\u4f5c\u7528\u5728 CALayer \u4e0a&#xff0c;\u4e0d\u662f UIView\u4e09\u3001CABasicAnimation \u7684\u4e09\u4e2a\u6838\u5fc3\u8981\u7d201. keyPath \u2014\u2014","og_url":"https:\/\/www.wsisp.com\/helps\/108980.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-22T20:40:44+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/108980.html","url":"https:\/\/www.wsisp.com\/helps\/108980.html","name":"iOS: CABasicAnimation\u52a8\u753b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-22T20:40:44+00:00","dateModified":"2026-09-22T20:40:44+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/108980.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/108980.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/108980.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"iOS: CABasicAnimation\u52a8\u753b"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/108980","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=108980"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/108980\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=108980"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=108980"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=108980"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=108980"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}