1
我正在使用小型UIWebView
,并且scalesPageToFit
对某些网址无法正常工作。 (看上去像是以100%无法改变(但如果我缩小手动的WebView(手势),它的工作UIWebview scalesPageToFit无法正常工作
view = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 200.0f, 400.0f)];
webViewT = [[UIWebView alloc] initWithFrame:view.bounds];
webViewT.delegate = self;
webViewT.scalesPageToFit = YES;
NSURL* url = [NSURL URLWithString:@"http://www.google.com/"];
[webViewT loadRequest:[NSURLRequest requestWithURL:url]];
请注意,我已经找到了解决办法:!(下面的工作,但我有的时候,看到一个“调整”
- (void) webViewDidFinishLoad:(UIWebView *)webViewT {
if ([theWebView respondsToSelector:@selector(scrollView)])
{
UIScrollView *scroll=[theWebView scrollView];
float zoom=theWebView.bounds.size.width/scroll.contentSize.width;
[scroll setZoomScale:zoom animated:NO];
}
}
任何想法?谢谢!
的[UIWebView的不结垢内容以适合]可能重复(http://stackoverflow.com/questions/1511707/uiwebview-does-没有规模化内容,以配合) – 2014-10-10 11:44:51