1

我为此使用 UIWebView 可能听起来很奇怪,但是对于这个项目是如何组合在一起的,我必须这样做。

我创建了一个显示图像的 UIWebView:

[webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"flatPano" ofType:@"html"]isDirectory:NO]]];

webView.frame = CGRectMake(0, 0, 1024, 768);    

for (id subview in webView.subviews)
    if ([[subview class] isSubclassOfClass: [UIScrollView class]])
        ((UIScrollView *)subview).bounces = NO;

在我的 html 文件中,我有一个视口元标记:

<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1.5, minimum-scale=1.5, maximum-scale=3.0, user-scalable=yes"/>

在我的身体中,我有一个简单的 img 标签,以便显示图像。初始、最小和最大比例在大多数情况下都可以正常工作,但问题是我可以通过捏合来缩小最小比例,然后我放手,它会重新回到最小比例。从外观上看,这不可能发生,因为没有白色背景可以显示。

4

0 回答 0