Reputation: 846
I have a UIView drawn in Storyboard which holds some buttons and which is called viewHolder.
I get a higher position rectForAnimationBefore
and a lower position rectForAnimationAfter
[UIView animateWithDuration:1.0
delay:0.0
options:UIViewAnimationOptionCurveEaseInOut
animations:nil completion:^(BOOL finish){
[self.viewHolder setFrame:rectForAnimationAfter];
}];
when this is excuted,the viewHolder
do move down.After a second,it comes up as nothing was done.
I want to moveDown,but don't want moveUp Automatically.
Because autolayout in Storyboard? By the way ,how to move it smoothly?
Thank you guys.
UPDATE:
[UIView animateWithDuration:1.0
delay:0.0
options:UIViewAnimationOptionCurveEaseInOut
animations:^{
[self.viewHolder setFrame:rectForAnimationAfter];
}
completion:^(BOOL finish){
}];
when I change code like this ,I can't move it down .
Here is my solution
unlock the autolayout!!!
Upvotes: 1
Views: 595
Reputation: 281
First thing your animation block is nil. Here you should move your view down. At completion you are setting back you view without using any animation. For smoothness you need to move back your view animatedly.
Upvotes: 1