iOS project development-a scaled animation of the production view

Source: Internet
Author: User

The size of the view should be controllable at all times. Today we're going to implement a zoom animation of a view. The implementation of this animation is slightly different from displacement animation, transparency animation. The specific implementation is as follows:

Import Uikitclass Scaleviewcontroller:uiviewcontroller {            @IBOutlet weak var greensquare:uiview!        Override Func Viewdidload () {        super.viewdidload ()        //Do any additional setup after loading the view.    }    Override Func didreceivememorywarning () {        super.didreceivememorywarning ()        //Dispose of any of the resources that can Be recreated.    }        Override func Viewdidappear (animated:bool) {        super.viewdidappear (animated)                func Anim () {                    Self.greenSquare.transform = Cgaffinetransformmakescale (0.5, 0.5)//reduced to 0.5 times times the original;        }                        Uiview.animatewithduration (1, Animations:anim)                            }}

(3) Run the program and find that the view can be 0.5 times times the original x, Y axis.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

iOS project development-a scaled animation of the production view

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.