一个UIWebView和动画 [英] UIWebView and Animation

查看:157
本文介绍了一个UIWebView和动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有动画一个UIWebView的大小和位置的方法。
如果我折腾是这样的:

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);
}];

[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)

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)

上有什么建议?

推荐答案

有没有破解文本宽度的瞬间万变,但还可以通过编程方式改变的UIWebView来clearColor的背景下摆脱灰色框。如果你这样做,通过界面生成器,因为某些原因无法正常工作。

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.

这篇关于一个UIWebView和动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆