我不知道添加动画可以使消失的模糊效果,所以感谢您的帖子,这是有帮助的。
我寻找你但不幸的是,的ondermerol答案不为我工作相同的解决方案。
我修复使用的UIScrollView的委托 - >UIScrollViewDelegate
1)在你的类
@property (nonatomic) BOOL webViewWasForceZooming;
2)添加BOOL财产在viewDidLoad中,连接您的代表并设置BOOL值
self.webView.scrollView.delegate = self;
self.webViewWasForceScrolling = NO;
3)设置新的规模
self.webView.hidden = YES;
webViewWasForceZooming = YES;
[self.webView.scrollView setZoomScale:2.0 animated:YES];
4)变焦
#pragma mark - UIScrollViewDelegate
- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(CGFloat)scale
{
if (webViewWasForceZooming) {
webViewWasForceZooming = NO;
self.webView.hidden = NO;
}
}
因为动画时长不为空,但我的解决方案并不完美展后回web视图在webview加载后改变缩放,这很好。
希望它能帮助别人。