gpt4 book ai didi

html - 使用 Swift 4 调整 html 文件内容的大小

转载 作者:行者123 更新时间:2023-11-28 01:00:42 24 4
gpt4 key购买 nike

我将网络文件(html、css、javascript)添加到我的 iOS 应用程序,并使用 WKWebView 正确连接所有内容。不幸的是,html 对于 iphone 屏幕来说太宽了,无法正确滚动。在从本网站、苹果文档等尝试了几种可能的解决方案后,没有任何效果。 html 内容对于 iPhone 屏幕尺寸来说太大了。如果我返回并手动更改 CSS 中的所有像素大小以适合一个 iPhone 屏幕尺寸,那么它就不会适合其他手机尺寸。有没有办法使用 Swift 4 和 WKWebview 进行缩放以适应或启用水平滚动?

最佳答案

尝试以下任一方法:

<meta name="viewport" content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0">
<meta name="format-detection" content="telephone=no">
<meta name="apple-mobile-web-app-capable" content="yes" />

关于html - 使用 Swift 4 调整 html 文件内容的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52683308/

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