I am trying to resize a UIWebView like this:
CGRect oldFrame = zoomView.frame;
zoomView.layer.anchorPoint = CGPointMake(1, 0.5);
zoomView.frame = oldFrame;
if (oldFrame.size.width == 1024) {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:2.0];
zoomView.frame = CGRectMake(512, 0, 512, 470);
[UIView commitAnimations];
} else {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:2.0];
zoomView.frame = CGRectMake(0, 0, 1024, 470);
[UIView commitAnimations];
}
The resize works, but the content of the Webview won’t follow the resize. It looks like the content get set to the new bounds first and then the View resizes. In the case from 1024 width to 512, the content get set to 512 width directly and then the view shrinks to its new size and position.
What do I oversee here?
Seems it this is the way how animating size and origin get animated. The scrollview won’t get updated during this. Solved it by using an own timer and move the view myself.