0

I think I'm probably missing something obvious here?

I have a UITextView that I animate it's y position when a user takes a certain action via

CGRect frame = self.messageTextView.frame;

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];

frame.origin.y += 120;
self.messageTextView.frame = frame;

[UIView commitAnimations];

That works great, but when my user taps a button to launch an imagePicker that animated UITextView snaps back to its original position as the imagePicker launches so, when the imagePicker is dismissed, my UITextView is in an unexpected place (where it began, not where it was animated to). Why is that? And how can I get it to retain its new position?

thanks!

4

1 回答 1

1

我通过取消选中 UITextView 上的“使用自动布局”解决了我自己的问题。自动布局约束将视图捕捉回其起始位置:\

于 2013-07-19T19:33:36.763 回答