UIWebView and Animation

余生颓废 提交于 2019-12-30 05:02:27

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/5867060/uiwebview-and-animation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!