The use of AutoLayout layout, as a beginner will be all of us will think again and animation missed, no longer to achieve the effect of animation.
But, I want to say, little friends, your ideas are wrong.
In the case of using AutoLayout, we can also achieve the effect of animation.
View in storyboard, the basic layout is achieved by constraints constraints, by changing the control's
Transform properties to achieve basic animation effects.
The view add constraints is actually a restriction on the coordinate position of the bounds in the view, and the animation effect can be achieved by modifying the relative coordinates on the bounds in the views. (modifies the relative position of the bounds and does not affect the coordinates of the frame of the child view in view).
Test code:
Class Viewcontroller:uiviewcontroller {
@IBOutlet weak var passwordlabel:uilabel!
@IBOutlet weak var phonelabel:uilabel!
@IBOutlet weak var toplabel:uilabel!
Override Func Viewdidload () {
Super.viewdidload ()
Toplabel.transform = cgaffinetransformmaketranslation (0,-200)
Passwordlabel.transform = cgaffinetransformmaketranslation (-200,-200)
Phonelabel.transform = cgaffinetransformmaketranslation (-200, 0)
Do no additional setup after loading the view, typically from a nib.
}
Override func Viewdidappear (Animated:bool) {
Uiview.animatewithduration (0.5) {
Self.topLabel.transform = cgaffinetransformidentity
Self.phoneLabel.transform = cgaffinetransformidentity
Self.passwordLabel.transform = cgaffinetransformidentity
}
}