S
S
Sunset_over2015-09-02 20:22:43
Objective-C
Sunset_over, 2015-09-02 20:22:43

How does animation work with autolayout?

Good evening, how does a simple animation with autolayot ​​work? Let's say a simple movement of a component.
When using UVIEW Animation, strange situations constantly occur.
For example, the component may not move from the first call, or the component will fly to the wrong place, and many others.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
An, 2015-09-04
@Sunset_over

The constraints themselves are animated
. For example, you need to animate the movement of the view from left to right, grab the leading constrainte in the interface buildere and drag it into the code to make an outlet
Next, in the place where you need to animate
constrain.const=10;
[UIView animateWith......:^{
[ self.view layoutIfNeeded]
}];

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question