gpt4 book ai didi

animation - UIWebView 和动画

转载 作者:行者123 更新时间:2023-12-04 21:24:33 25 4
gpt4 key购买 nike

我想知道是否有办法为 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)

对此有何建议?

最佳答案

还没有破解文本宽度的即时更改,但是您可以通过以编程方式将 UIWebView 的背景更改为 clearColor 来摆脱灰色框。出于某种原因,如果您通过 Interface Builder 执行此操作,则不起作用。

关于animation - UIWebView 和动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5867060/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com