How animations are turned on in the UI of iOS development

Source: Internet
Author: User

How animations are turned on in the UI

Turn on animation is a feature attribute in Uiimageview

have progressive animation and sequence frame animations

Progressive animations include kinsoku and block animations

A sequence frame animation is an animated effect of playing a contiguous set of pictures in a very short period of time

First you need to create a Uiimageview object for ImageView
1. Sequence frame animation basic steps

Assigns the array of pictures to be played to the Animationimages property of the Uiimageview object, which is an array object

Imageview.animationimages=array

Set the number of executions of an animation (Animationrepeatcount property)

Imageview.animationrepeatcount

Set the execution time of an animation

Imageview.animationduration

Start animation

[ImageView startanimating]

Stop animation

[ImageView stopanimating]

Determines whether the animation is executing

[ImageView isanimating]

How long animation delays performing other methods

[ImageView performselector:<# (nonnull SEL) #> withobject:<# (nullable ID) #> afterdelay:<# ( Nstimeinterval) #>]

In the above method:

<# (SEL) #> is called a method that invokes a method in the object used earlier

<# (ID) #> is the parameter passed in by the method

<# (nstimeinterval) #> delay how much time to execute the method in the SEL

2.block Animation (Common)

A class method that calls UIView directly can

[UIView animatewithduration:<# (Nstimeinterval) #> animations:<#^ (void) animations#>

<# (nstimeinterval) #> animation execution Time

<#^ (void) animations#> block structure write code to perform animation

3. Tail-up animation

Turn on animation

UIView beginanimations:<# (Nullable NSString *) #> context:<# (Nullable void *) #>]

<# (Nullable NSString *) #> the name of the picture to perform the animation

<# (Nullable void *) #> general assignment is nil

Submit Animation

[UIView Commitanimations]

Another: In the Click to perform these animations are generally associated with these other functions

For example: Zoom in and out of the image will be corresponding to the Change button frame center bounds and transform these properties according to the specific function of the specific judge

How animations are turned on in the UI of iOS development

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.