Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIWebView and Animation

I am wondering if there was a way to animate the size and position of a UIWebView. If I do sth like this:

[UIView animateWithDuration:1.0 animations:^{
    self.frame = CGRectMake(20.0, 20.0, 80.0, 80.0);
}];

or

[UIView beginAnimations:@"zoomIn" context:nil];
[UIView setAnimationDuration:2.75]; 
[UIView setAnimationDelegate: self];

    self.frame = CGRectMake(20.0, 20.0, 80.0, 80.0);

[UIView commitAnimations];

while there is a grey box doing the animation, the content of the WebView instantly switches to the new size without animating. (the scalesPageToFit property is set to YES)

any suggestions on that?

like image 621
Micky Avatar asked Nov 05 '22 22:11

Micky


1 Answers

Haven't cracked the instant changing of the text width yet but you can get rid of the grey box by programmatically changing the background of the UIWebView to clearColor. Doesn't work if you do it through Interface Builder, for some reason.

like image 93
user489998 Avatar answered Nov 10 '22 04:11

user489998