gpt4 book ai didi

ios - UIWebView 在 iOS8 中不缩放

转载 作者:行者123 更新时间:2023-11-29 12:34:19 24 4
gpt4 key购买 nike

我想在 WebView 中放大。我在 iOS 中较新。请帮助我。有人说这是 WebView 的默认属性。我正在 iOS8 中测试。它对我不起作用。

self.myWebView= [[UIWebView alloc] init];
[self.myWebView setScalesPageToFit:YES];
[self.myWebView setDelegate:self];
[self.myWebView.scrollView setDelegate:self];
[self.myWebView setDataDetectorTypes:UIDataDetectorTypeNone];
[self.myWebView.scrollView setBounces:NO];
[self.myWebView.scrollView setShowsHorizontalScrollIndicator:NO];
[self.myWebView.scrollView setShowsVerticalScrollIndicator:NO];
[myScrollView addSubview:self.myWebView];

- (void)webViewDidFinishLoad:(UIWebView *)theWebView
{

self.myWebView.scrollView.delegate = self;
self.myWebView.scrollView.maximumZoomScale = 20; // set as you want.
self.myWebView.scrollView.minimumZoomScale = 1; // set as you want.
}
(void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(CGFloat)scale
{
self.myWebView.scrollView.maximumZoomScale = 20;
}

最佳答案

if u are not use viewForZoomingInScrollView they work automatically. if you are use viewForZoomingInScrollView 
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
{

if (scrollView ==myWebView.scrollView){

return self.myWebView;
}
else
{
return nil;
}
}

关于ios - UIWebView 在 iOS8 中不缩放,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26777395/

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