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];
当有一个灰色的盒子在做动画时, WebView 的内容立即切换到新的大小,而无需动画。 (scalesPageToFit 属性设置为 YES)
对此有何建议?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尚未破解文本宽度的即时更改,但您可以通过以编程方式将 UIWebView 的背景更改为clearColor 来摆脱灰色框。由于某种原因,如果您通过 Interface Builder 执行此操作,则不起作用。
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.