0
votes

I know how to do basic position animations in iOS for views that do not have any constraints on them, and how to animate the constant in a constraint, but I don't know how to combine the two. Basically I created a view in IB that takes up half the screen and has constraints on the individual elements as shown in this picture.

enter image description here

There are leading and trailing edges on each of those 3 UIStackViews where each has a label and a UITextField or UITextView. What I'd like to do is position the view off screen to the right, and then an event happens, slide it to the left so it all fits on screen with the leading and trailing constraints. Then when another event happens, slide it to the left again off screen. When I set the leading and trailing constraints to isActive = false, my view is completely gone. If I try to change the constants for the leading and trailing constraints' constant value by the same amount, the elements in the container view seem to be cut off vs shifting the view over that amount.

Or are you supposed to not set up the container view with any constraints, animate the view, and then add the constraints you need?

1

1 Answers

-1
votes

Have you tried constraint's priority.that may does some work