<span id="Label3"></p><em class="corner"><em class="corner">Summary</em></em>This article mainly introduces the animation in kernel ios: core animation Animation, uiview animation, block animation, uiimageview frame Animation. core animation cores Animation UIView animation block animation Frame Animations for Uiimageview<p class="osc_h1"><p class="osc_h1">Animations in iOS</p></p><p class="osc_h2"><p class="osc_h2">Core Animation</p></p><p class="osc_h3"><p class="osc_h3">Caanimation:</p></p><p class="osc_h3"><p class="osc_h3">Capropertyanimation</p></p><p class="osc_h3"><p class="osc_h3">Cakeyframeanimation</p></p><p class="osc_h3"><p class="osc_h3">Catransition</p></p><p class="osc_h2"><p class="osc_h2">UIView Animation</p></p><p class="osc_h2"><p class="osc_h2">Block animation</p></p><p class="osc_h2"><p class="osc_h2">Frame Animations for Uiimageview</p></p><p class="osc_h2"><p class="osc_h2">Uiactivityindicatorview</p></p>Animations in iOS<span style="line-height: 23px; font-size: 24px;"><span style="line-height: 23px; font-size: 24px;">Core Animation</span></span><p><p>Core animation is a very powerful set of animation processing APIs that use it to make very brilliant animations, often with less effort, and use it to add Quartzcore. framework and introduction of corresponding frameworks <quartzcore/ Quartzcore.h>.</p></p><p><p>Development Steps:</p></p><p><p>1> Initializes an animated object (caanimation) and sets some animation-related Properties.</p></p><p><p>2> add an animated object to the layer (calayer) to begin the Animation.</p></p><p><p>Many of the properties in Calayer can be animated by caanimation, including opacity, position, transform, bounds, contents, etc. (can be searched in the API documentation: Calayer animatable Properties).</p></p><p><p>By calling Calayer's Addanimation:forkey: increase the animation to the layer (calayer) so that the animation can be triggered. by calling Removeanimationforkey: you can stop the animation in the Layer.</p></p><p><p>The animation execution of Core animation is performed in the background and does not block the main thread.</p></p>Caanimation:<p><p>The parent class of all animated objects, which controls the duration and speed of the animation, is an abstract class that cannot be used directly and should use its specific subclasses.</p></p><p><p>Attribute Parsing:</p></p><p><p>Duration: the duration of the Animation.</p></p><p><p>Repeatcount: the number of repetitions of the Animation.</p></p><p><p>Repeatduration: the repetition time of the Animation.</p></p><p><p>Removedoncompletion: The default is yes, which is removed from the layer after the animation has finished executing, and the drawing reverts to the state before the animation was Executed. If you want the layer to remain displayed after the animation has been executed, set it to no, but also set Fillmode to KCAFILLMODEFORWARDS.</p></p><p><p>Fillmode: determines the behavior of the current object during a non-active time period. for example, before the animation begins, the animation ends.</p></p><p><p>BeginTime: can be used to set the animation delay execution time, If you want to delay 2s, set to Cacurrentmediatime () +2, cacurrentmediatime () is the current time of the Layer.</p></p><p><p>Timingfunction: speed control function to control the rhythm of the animation Operation.</p></p><p><p>Delegate: Animation Agent</p></p><p><p>Speed control function (camediatimingfunction)</p></p><p><p>1> kcamediatimingfunctionlinear (linear): constant, gives you a relatively static feeling</p></p><p><p>2> Kcamediatimingfunctioneasein (progressive): Animation slowly enters, then accelerates to leave</p></p><p><p>3> kcamediatimingfunctioneaseout (fade out): animation enters at full speed, then slows down to the destination</p></p><p><p>4> kcamediatimingfunctioneaseineaseout (progressive Fade out): The animation slowly enters, the middle accelerates, and then slows down to the Destination. This is the default animation Behavior.</p></p><p><p>Caanimation defines the proxy method in the classification</p></p><p><p>@interface NSObject <CAAnimationDelegate></p></p><p><p>-(void) animationdidstart: (caanimation *) anim;</p></p><p><p>-(void) animationdidstop: (caanimation *) anim finished: (BOOL) flag;</p></p><p><p>@end</p></p><p><p>Fillmode property value (if you want Fillmode to work, it's best to set Removedoncompletion=no)</p></p><p><p>Kcafillmoderemoved This is the default value, that is, when the animation starts and after the end of the animation, the animation has no effect on the layer, after the end of the animation, the layer will revert to the previous state?</p></p><p><p>Kcafillmodeforwards when the animation finishes, the layer retains the final state of the Animation.</p></p><p><p>? Kcafillmodebackwards before the animation begins, you just add the animation to a layer,layer and immediately enter the initial state of the animation and wait for the animation to Begin. <span style="font-size: 12.5px;">you can set the test code so that an animation is added to a layer with a delay of 5 seconds to Execute. then you will find that when the animation is not started, as long as the animation is added to the layer,layer in the initial state of animation?</span></p></p><p><p>Kcafillmodeboth This is actually the composition of the above two. before the animation joins, the layer is in the initial state of the animation, and the layer retains the final shape after the animation finishes.</p></p>Capropertyanimation<p><p>The subclass of caanimation, also an abstract class, should use its two subclasses to create an animated object: cabasicanimation and Cakeyframeanimation.</p></p><p><p>Attribute Parsing:</p></p><p><p>Keypath:</p></p><p><p>By specifying a property name of Calayer as KeyPath (nsstring type), and modifying the value of this property of calayer, the corresponding animation effect is Achieved. For example, If you specify @ "position" as keypath, the value of the position property of the Calayer is modified to achieve the animated effect of panning</p></p><p><p>Cabasicanimation</p></p><p><p>The subclass of the Capropertyanimation.</p></p><p><p>Attribute Parsing:</p></p><p><p>Fromvalue:keypath the initial value of the corresponding Property.</p></p><p><p>Tovalue:keypath the end value of the corresponding Property.</p></p><p><p>As the animation progresses, the value of the keypath corresponding property is gradually changed from Fromvalue to Tovalue for the duration of the duration Length.</p></p><p><p>If Fillmode=kcafillmodeforwards and Removedoncomletion=no are complete, the layer remains displayed after the animation is Executed. But in essence, the property value of the layer is still the initial value before the animation is executed, and it is not really changed. For example, Calayer's Position initial value is (0,0), cabasicanimation fromvalue is (10,10), Tovalue is (100,100), although the animation after the completion of the layer remains at (100,100) this position, The position of the physical layer is still for (0,0)</p></p>? <table border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td class="gutter">123456789101112131415161718192021222324</td> <td class="code"><code class="cpp comments"><code class="cpp comments">//平移动画</code></code><code class="cpp plain"><code class="cpp plain">CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@</code></code><code class="cpp string"><code class="cpp string">"position"</code></code><code class="cpp plain"><code class="cpp plain">];</code></code><code class="cpp comments"><code class="cpp comments">// 动画持续1秒</code></code><code class="cpp plain"><code class="cpp plain">anim.duration =1; </code></code><code class="cpp comments"><code class="cpp comments">//因为CGPoint是结构体,所以用NSValue包装成一个OC对象</code></code><code class="cpp plain"><code class="cpp plain">anim.fromValue = [NSValue valueWithCGPoint:CGPointMake(50, 50)];</code></code><code class="cpp plain"><code class="cpp plain">anim.toValue = [NSValue valueWithCGPoint:CGPointMake(100, 100)];</code></code><code class="cpp comments"><code class="cpp comments">//通过MyAnim可以取回相应的动画对象,比如用来中途取消动画</code></code><code class="cpp plain"><code class="cpp plain">[layer addAnimation:anim forKey:@</code></code><code class="cpp string"><code class="cpp string">"MyAnim"</code></code><code class="cpp plain"><code class="cpp plain">];</code></code><code class="cpp comments"><code class="cpp comments">//缩放动画</code></code><code class="cpp plain"><code class="cpp plain">CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@</code></code><code class="cpp string"><code class="cpp string">"transform"</code></code><code class="cpp plain"><code class="cpp plain">];</code></code><code class="cpp comments"><code class="cpp comments">//没有设置fromValue说明当前状态作为初始值</code></code><code class="cpp comments"><code class="cpp comments">//宽度(width)变为原来的2倍,高度(height)变为原来的1.5倍</code></code><code class="cpp plain"><code class="cpp plain">anim.toValue = [NSValuevalueWithCATransform3D:CATransform3DMakeScale(2, 1.5, 1)];</code></code><code class="cpp plain"><code class="cpp plain">anim.duration = 1;</code></code><code class="cpp plain"><code class="cpp plain">[layer addAnimation:anim forKey:nil];</code></code><code class="cpp comments"><code class="cpp comments">//旋转动画</code></code><code class="cpp plain"><code class="cpp plain">CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@</code></code><code class="cpp string"><code class="cpp string">"transform"</code></code><code class="cpp plain"><code class="cpp plain">];</code></code><code class="cpp comments"><code class="cpp comments">//这里是以向量(1, 1, 0)为轴,旋转π/2弧度(90°)</code></code><code class="cpp comments"><code class="cpp comments">//如果只是在手机平面上旋转,就设置向量为(0, 0, 1),即Z轴</code></code><code class="cpp plain"><code class="cpp plain">anim.toValue = [NSValuevalueWithCATransform3D:CATransform3DMakeRotation(M_PI_2, 1, 1, 0)];</code></code><code class="cpp plain"><code class="cpp plain">anim.duration = 1;</code></code><code class="cpp plain"><code class="cpp plain">[layer addAnimation:anim forKey:nil];</code></code></td> </tr> </tbody> </table><span style="font-size: 18px;"><span style="font-size: 18px;">cakeyframeanimation</span></span><p><p><span style="font-size: 12.5px;"><span style="font-size: 12.5px;">capropertyanimation subclasses, The difference with cabasicanimation is:</span></span></p></p><p><p><span style="font-size: 12.5px;">Cabasicanimation can only change from one numeric value (fromvalue) to another (tovalue), and Cakeyframeanimation saves the values using a nsarray.</span></p></p><p><p><span style="font-size: 12.5px;">Attribute Parsing:</span></p></p><p><p><span style="font-size: 12.5px;">Values: This is the Nsarray object. The elements inside are called "keyframes" (keyframe). The animated object displays each keyframe in the values array in the specified time (duration).</span></p></p><p><p><span style="font-size: 12.5px;">Path: you can set a cgpathref\cgmutablepathref so that the layer moves along the path. Path only works on Calayer's Anchorpoint and Position. If you set the path, values will be Ignored.</span></p></p><p><p><span style="font-size: 12.5px;">Keytimes: you can specify a corresponding point in time for the corresponding keyframe, and each time value in the range from 0 through 1.0,keytimes corresponds to each frame in Values. when the keytimes is not set, the time of each keyframe is equally divided.</span></p></p><p><p><span style="font-size: 12.5px;">Cabasicanimation can be seen as a maximum of only 2 keyframes cakeyframeanimation</span></p></p><p><p><span style="font-size: 12.5px;"><span style="font-size: 12.5px;">There is also a very important parameter in the Keyframe animation, which is calculationmode, the calculation Mode. it is mainly for the contents of each frame as a block punctuation, that is, to anchorpoint and position Animation. when there are multiple discrete points in a planar coordinate system, they can be discrete, or they can be interpolated after straight lines, or they can be interpolated using a sleek Curve. Calculationmode currently offers several modes:</span></span></p></p><p><p>The default value of Kcaanimationlinear calculationmode, which means that when keyframes are block punctuation, the direct straight line between keyframes is interpolated to calculate the interpolation value;</p></p><p><p>Kcaanimationdiscrete discrete, is not the interpolation calculation, all the key frames are displayed directly;</p></p><p><p>Kcaanimationpaced makes the animation uniform, not keytimes set or split the time according to the key frame, when Keytimes and timingfunctions are not valid;</p></p><p><p>Kcaanimationcubic The key frame is the key frame for the seat punctuation after the smooth curve connected to the interpolation calculation, the main purpose here is to make the trajectory of the operation to become smooth;</p></p><p><p>kcaanimationcubicpaced see this name to know and Kcaanimationcubic have a certain connection, in fact, is on the basis of Kcaanimationcubic make the animation run evenly, is the system time within the same distance movement, Keytimes and timingfunctions are also invalid at this Time.</p></p><p><p>Caanimationgroup</p></p><p><p><span style="font-size: 12.5px;">caanimation, You can save a set of animated objects, and after the Caanimationgroup object is added to the layer, all animation objects in the group can run concurrently simultaneously.</span></p></p><p><p>Attribute Parsing:</p></p><p><p>Animations: a nsarray used to hold a set of animated Objects.</p></p><p><p>By default, a set of animated objects runs at the same time, or you can change the start time of an animation by setting the BeginTime property of the animated Object.</p></p>Catransition<p><p><span style="font-size: 12.5px;">a subclass of caanimation, used for transition animations, to provide layers with animated effects for moving out of the screen and moving into the Screen. iOS has less transition animations than Mac OS X.</span></p></p><p><p>The Uinavigationcontroller is an animated effect that pushes the Controller's view onto the screen through Catransition.</p></p><p><p>Attribute Parsing:</p></p><p><p>Type: Animation Transition Types</p></p><p><p>Subtype: Animation Transition Direction</p></p><p><p>Startprogress: start of animation (percentage in overall Animation)</p></p><p><p>Endprogress: end of animation (percentage in overall Animation)</p></p>? <table border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td class="gutter">123456789101112131415161718192021222324252627</td> <td class="code"><code class="cpp comments"><code class="cpp comments">/* 过渡效果</code></code><code class="cpp spaces"><code class="cpp spaces"> </code></code><code class="cpp comments"><code class="cpp comments">fade //交叉淡化过渡(不支持过渡方向) kCATransitionFade</code></code><code class="cpp spaces"><code class="cpp spaces"> </code></code><code class="cpp comments"><code class="cpp comments">push //新视图把旧视图推出去 kCATransitionPush</code></code><code class="cpp spaces"><code class="cpp spaces"> </code></code><code class="cpp comments"><code class="cpp comments">moveIn //新视图移到旧视图上面 kCATransitionMoveIn</code></code><code class="cpp spaces"><code class="cpp spaces"> </code></code><code class="cpp comments"><code class="cpp comments">reveal //将旧视图移开,显示下面的新视图 kCATransitionReveal</code></code><code class="cpp spaces"><code class="cpp spaces"> </code></code><code class="cpp comments"><code class="cpp comments">cube //立方体翻滚效果</code></code><code class="cpp spaces"><code class="cpp spaces"> </code></code><code class="cpp comments"><code class="cpp comments">oglFlip //上下左右翻转效果</code></code><code class="cpp spaces"><code class="cpp spaces"> </code></code><code class="cpp comments"><code class="cpp comments">suckEffect //收缩效果,如一块布被抽走(不支持过渡方向)</code></code><code class="cpp spaces"><code class="cpp spaces"> </code></code><code class="cpp comments"><code class="cpp comments">rippleEffect //滴水效果(不支持过渡方向)</code></code><code class="cpp spaces"><code class="cpp spaces"> </code></code><code class="cpp comments"><code class="cpp comments">pageCurl //向上翻页效果</code></code><code class="cpp spaces"><code class="cpp spaces"> </code></code><code class="cpp comments"><code class="cpp comments">pageUnCurl //向下翻页效果</code></code><code class="cpp spaces"><code class="cpp spaces"> </code></code><code class="cpp comments"><code class="cpp comments">cameraIrisHollowOpen //相机镜头打开效果(不支持过渡方向)</code></code><code class="cpp spaces"><code class="cpp spaces"> </code></code><code class="cpp comments"><code class="cpp comments">cameraIrisHollowClose //相机镜头关上效果(不支持过渡方向)</code></code><code class="cpp spaces"><code class="cpp spaces"> </code></code><code class="cpp comments"><code class="cpp comments">*/</code></code><code class="cpp spaces"><code class="cpp spaces"> </code></code><code class="cpp comments"><code class="cpp comments">/* 过渡方向</code></code><code class="cpp spaces"><code class="cpp spaces"> </code></code><code class="cpp comments"><code class="cpp comments">kCATransitionFromRight</code></code><code class="cpp spaces"><code class="cpp spaces"> </code></code><code class="cpp comments"><code class="cpp comments">kCATransitionFromLeft</code></code><code class="cpp spaces"><code class="cpp spaces"> </code></code><code class="cpp comments"><code class="cpp comments">kCATransitionFromBottom </code></code><code class="cpp spaces"><code class="cpp spaces"> </code></code><code class="cpp comments"><code class="cpp comments">kCATransitionFromTop</code></code><code class="cpp spaces"><code class="cpp spaces"> </code></code><code class="cpp comments"><code class="cpp comments">*/</code></code><code class="cpp comments"><code class="cpp comments">// CATransition的使用 </code></code><code class="cpp plain"><code class="cpp plain">CATransition *anim = [CATransition animation];</code></code><code class="cpp plain"><code class="cpp plain">anim.type = @</code></code><code class="cpp string"><code class="cpp string">"cube"</code></code><code class="cpp plain"><code class="cpp plain">; </code></code><code class="cpp comments"><code class="cpp comments">// 动画过渡类型</code></code><code class="cpp plain"><code class="cpp plain">anim.subtype = kCATransitionFromTop; </code></code><code class="cpp comments"><code class="cpp comments">// 动画过渡方向</code></code><code class="cpp plain"><code class="cpp plain">anim.duration = 1; </code></code><code class="cpp comments"><code class="cpp comments">// 动画持续1s</code></code><code class="cpp comments"><code class="cpp comments">// 代理,动画执行完毕后会调用delegate的animationDidStop:finished:</code></code><code class="cpp plain"><code class="cpp plain">anim.delegate = self;</code></code></td> </tr> </tbody> </table>UIView Animation<p><p><span style="font-size: 12.5px;">Uikit integrates animations directly into the UIView class, and UIView provides animated support for these changes when some of the internal properties Change.</span></p></p><p><p>The work required to perform the animation is done automatically by the UIView class, but you still want to notify the view when you want to perform the animation, for which you need to place the code that changes the property in [UIView Beginanimations:nil context:nil] and [UIView commitanimations] between</p></p><p><p>Common Method Parsing:</p></p><p><p>+ (void) setanimationdelegate: (id) delegate</p></p><p><p>Sets the animation proxy object, which sends a message to the proxy object when the animation starts or ends</p></p><p><p><span style="font-size: 12.5px;">+ (void) setanimationwillstartselector: (SEL) Selector</span></p></p><p><p>When the animation is about to begin, execute the selector of the delegate object and pass in the beginanimations:context: the parameters passed into the selector</p></p><p><p>+ (void) setanimationdidstopselector: (SEL) Selector</p></p><p><p>When the animation ends, the selector of the delegate object is executed, and the parameters passed in Beginanimations:context: are passed into the selector</p></p>? <table border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td class="gutter">12345678910</td> <td class="code"><code class="cpp comments">//说明需要执行动画</code><code class="cpp plain">[UIView beginAnimations:nil context:nil];</code><code class="cpp comments">//设置动画持续时间</code><code class="cpp plain">[UIView setAnimationDuration:1];</code><code class="cpp comments">//设置转场动画</code><code class="cpp plain">[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES];</code><code class="cpp comments">//交换子视图的位置</code><code class="cpp plain">[self.view exchangeSubviewAtIndex:0 withSubviewAtIndex:1];</code><code class="cpp comments">//提交动画</code><code class="cpp plain">[UIView commitAnimations];</code></td> </tr> </tbody> </table><p><p>UIView Animation</p></p>? <table border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td class="gutter">1234567891011121314</td> <td class="code"><code class="cpp plain"><code class="cpp plain">+ (</code></code><code class="cpp keyword bold"><code class="cpp keyword bold">void</code></code><code class="cpp plain"><code class="cpp plain">)setAnimationDuration:(NSTimeInterval)duration</code></code><code class="cpp comments"><code class="cpp comments">//动画的持续时间,秒为单位</code></code><code class="cpp plain"><code class="cpp plain">+ (</code></code><code class="cpp keyword bold"><code class="cpp keyword bold">void</code></code><code class="cpp plain"><code class="cpp plain">)setAnimationDelay:(NSTimeInterval)delay</code></code><code class="cpp comments"><code class="cpp comments">//动画延迟delay秒后再开始</code></code><code class="cpp plain"><code class="cpp plain">+ (</code></code><code class="cpp keyword bold"><code class="cpp keyword bold">void</code></code><code class="cpp plain"><code class="cpp plain">)setAnimationStartDate:(NSDate *)startDate</code></code><code class="cpp comments"><code class="cpp comments">//动画的开始时间,默认为now</code></code><code class="cpp plain"><code class="cpp plain">+ (</code></code><code class="cpp keyword bold"><code class="cpp keyword bold">void</code></code><code class="cpp plain"><code class="cpp plain">)setAnimationCurve:(UIViewAnimationCurve)curve</code></code><code class="cpp comments"><code class="cpp comments">//动画的节奏控制,具体看下面的”备注”</code></code><code class="cpp plain"><code class="cpp plain">+ (</code></code><code class="cpp keyword bold"><code class="cpp keyword bold">void</code></code><code class="cpp plain"><code class="cpp plain">)setAnimationRepeatCount:(</code></code><code class="cpp color1 bold"><code class="cpp color1 bold">float</code></code><code class="cpp plain"><code class="cpp plain">)repeatCount</code></code><code class="cpp comments"><code class="cpp comments">//动画的重复次数</code></code><code class="cpp plain"><code class="cpp plain">+ (</code></code><code class="cpp keyword bold"><code class="cpp keyword bold">void</code></code><code class="cpp plain"><code class="cpp plain">)setAnimationRepeatAutoreverses:(</code></code><code class="cpp color1 bold"><code class="cpp color1 bold">BOOL</code></code><code class="cpp plain"><code class="cpp plain">)repeatAutoreverses</code></code><code class="cpp comments"><code class="cpp comments">//如果设置为YES,代表动画每次重复执行的效果会跟上一次相反</code></code><code class="cpp plain"><code class="cpp plain">+ (</code></code><code class="cpp keyword bold"><code class="cpp keyword bold">void</code></code><code class="cpp plain"><code class="cpp plain">)setAnimationTransition:(UIViewAnimationTransition)transitionforView:(UIView *)view cache:(</code></code><code class="cpp color1 bold"><code class="cpp color1 bold">BOOL</code></code><code class="cpp plain"><code class="cpp plain">)cache</code></code><code class="cpp comments"><code class="cpp comments">//设置视图view的过渡效果, transition指定过渡类型, cache设置YES代表使用视图缓存,性能较好</code></code></td> </tr> </tbody> </table>Block animation<p><p><span style="font-size: 12.5px;">+ (void) animatewithduration: (nstimeinterval) duration delay: (nstimeinterval) delay options: ( Uiviewanimationoptions) options animations: (void (^) (void)) animations completion: (void (^) (BOOL FINISHED)) Completion </span></p></p><p><p>Parameter resolution:</p></p><p><p>Duration: duration of animation</p></p><p><p>Delay: animation delays delay after seconds start</p></p><p><p>Options: Rhythm Control for animations</p></p><p><p>Animations: Place code that changes the properties of the view in this block</p></p><p><p>Completion: this block is automatically called after the animation is finished</p></p><p><p>+ (void) transitionwithview: (UIView *) view duration: (nstimeinterval) duration options: (uiviewanimationoptions) Options animations: (void (^) (void)) animations completion: (void (^) (BOOL FINISHED)) Completion</p></p><p><p>Parameter resolution:</p></p><p><p>Duration: duration of animation</p></p><p><p>View: views that require a transition animation</p></p><p><p>options: Types of transition animations</p></p><p><p>Animations: Place code that changes the properties of the view in this block</p></p><p><p>Completion: this block is automatically called after the animation is finished</p></p><p><p>+ (void) transitionfromview: (UIView *) fromview toview: (UIView *) toview duration: (nstimeinterval) duration options: ( Uiviewanimationoptions) options completion: (void (^) (BOOL FINISHED)) Completion</p></p><p><p>After the method call is complete, the following two lines of code are executed:</p></p><p><p>Add Toview to Parent view</p></p><p><p>[fromview.superview addsubview:toview];</p></p><p><p>Remove the Fromview from the parent view</p></p><p><p>[fromview.superview removefromsuperview];</p></p><p><p>Parameter resolution:</p></p><p><p>Duration: duration of animation</p></p><p><p>options: Types of transition animations</p></p><p><p>Animations: Place code that changes the properties of the view in this block</p></p><p><p>Completion: this block is automatically called after the animation is finished</p></p>Frame Animations for Uiimageview<p><p>Uiimageview allows a series of images to be displayed sequentially within a given Time.</p></p><p><p><span style="font-size: 12.5px;">Related attribute parsing:</span></p></p><p><p>Animationimages: the picture to be displayed (a Nsarray with uiimage).</p></p><p><p>Animationduration: the time required to fully display all the pictures in the Animationimages.</p></p><p><p>Animationrepeatcount: the number of times the animation was executed (default = 0, which represents an infinite loop)</p></p><p><p>Related Method parsing:</p></p><p><p>-(void) startanimating; Starts the Animation.</p></p><p><p>-(void) stopanimating; Stops the Animation.</p></p><p><p>-(BOOL) isanimating; Whether the animation is Running.</p></p>Uiactivityindicatorview<p><p>is a rotational progress wheel that can be used to inform the user that an operation is in progress and is normally initialized with Initwithactivityindicatorstyle.</p></p><p><p>Method Parsing:</p></p><p><p>-(void) startanimating; Start Animation</p></p><p><p>-(void) stopanimating; Stop animation</p></p><p><p>-(BOOL) isanimating; Whether the animation is running</p></p><p><p>The Uiactivityindicatorviewstyle has 3 values to choose From:</p></p><p><p>Uiactivityindicatorviewstylewhitelarge//large White Indicator</p></p><p><p>Uiactivityindicatorviewstylewhite//standard Size White Indicator</p></p><p><p>Uiactivityindicatorviewstylegray//grey indicator for white background</p></p><p><p>iOS Development Note--ios Animation summary</p></p></span>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service