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