【发布时间】:2012-08-28 16:05:32
【问题描述】:
我想将带有 UIWebView 和 UIToolbar 的 UIView 调整为带有动画的子视图。所以我使用以下代码:
[UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationCurveEaseInOut animations:^{
self.outerView.frame = CGRectMake(self.outerView.frame.origin.x, self.outerView.frame.origin.y, self.outerView.frame.size.width - 400, self.outerView.frame.size.height);
} completion:^(BOOL finished) {
}];
当 UIToolbar 按预期随着动画调整大小时,UIWebView 的内容会在动画完成后直接跳转到新的大小。
有没有人知道如何将动画也应用到 UIWebView?
【问题讨论】:
-
跳转的真的是WebView的内容还是UIWebView的内容?您知道在 WebView 的内容中触发 resize-event (quirksmode.org/dom/events/resize.html) 的频率吗?
-
感谢您的回答!是的,只有 WebView 中的内容会跳转。我为 WebView 添加了一个边框,它按预期调整了大小。我用 resize-event 进行了测试,发现它只被调用一次,所以这似乎是问题所在。
标签: objective-c ios uiwebview