Reputation: 21
I want to resize a UIView with a UIWebView and a UIToolbar as subviews with an animation. So I use the following code:
[UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationCurveEaseInOut animations:^{
self.outerView.frame = CGRectMake(self.outerView.frame.origin.x, self.outerView.frame.origin.y, self.outerView.frame.size.width - 400, self.outerView.frame.size.height);
} completion:^(BOOL finished) {
}];
While the UIToolbar resizes with the animation as expected the content of the UIWebView jumps directly to the new size after the animation finished.
Does anyone have an idea how to apply the animation to the UIWebView as well?
Upvotes: 2
Views: 1820
Reputation: 1542
I don't think it's possible as UIWebView refuses to update itself during an animation, what I suggest however is that you can set UIWebView's bounds as the destination you want to be and wrap it in a view, and by animating you can animating UIWebView's parent view. This way the animation is smooth with no jump and looks as if you reveal more content.
Upvotes: 1