UIWebView和动画
问题描述:
我想知道是否有一种方法来动画UIWebView的大小和位置。 如果我折腾这样的:UIWebView和动画
[UIView animateWithDuration:1.0 animations:^{
self.frame = CGRectMake(20.0, 20.0, 80.0, 80.0);
}];
或
[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];
同时有一个灰色的框做动画, 的web视图的内容瞬间切换到新的大小没有动画。 (scalesPageToFit属性设置为YES)
有什么建议吗?
答
尚未破解文本宽度的即时更改,但可以通过以编程方式将UIWebView的背景更改为clearColor来摆脱灰色框。出于某种原因,如果您通过Interface Builder执行此操作,则不起作用。