UIWebView和动画

5

我想知道是否有一种方法可以动态地改变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];

当灰色框执行动画时,WebView的内容会立即切换到新的大小,而不会进行动画。(scalesPageToFit属性设置为YES)您对此有什么建议吗?
1个回答

2

目前还没有破解文本宽度即时更改的方法,但是您可以通过编程将UIWebView的背景颜色更改为clearColor来消除灰色框。如果您通过Interface Builder进行更改,则无法实现此效果,原因未知。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接