gpt4 book ai didi

iphone - UIWebView 切换 scalespagetofit

转载 作者:可可西里 更新时间:2023-11-01 05:42:37 25 4
gpt4 key购买 nike

我想加载一些 html

<html><body style="margin: 0; padding: 0;"><img src="/++video?cameraNum=15&width=640&height=480&noScaleUp=1&auth=cmhiOkJpZ01hYw==&7427" width=341 height=256></body></html>

当我设置 scalesPageToFit = YES 时(在 IB 中选中)我可以捏缩放 webview 但图像的初始加载对于 webview 来说太小了:

enter image description here

如果我设置 scalesPageToFit = NO(在 IB 中未选中),则视频源会在加载时正确缩放,但现在用户无法缩放图片。 enter image description here

当然,我需要的是让网页加载适当的大小,然后允许用户捏合缩放,双击重置手势。

任何人都知道用代码或 javascript 等执行此操作的方法...?

谢谢,

罗布

最佳答案

在您的项目中使用元标记 我有一个在 ma 项目中使用的示例。

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" id="iphone-viewport" content="minimum-scale=1.0, maximum-scale=1.0, width=device-width>

这有用吗?

关于iphone - UIWebView 切换 scalespagetofit,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6284714/

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