禁用 iOS 文本输入缩放?

发布于 2024-12-26 11:04:58 字数 432 浏览 2 评论 0原文

我正在开发一个 iOS Web 应用程序,并且我将视口设置为不可缩放...

<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;" />

问题是,当我专注于输入文本字段时,它会放大并且不会缩小:

在此处输入图像描述

如何防止这种情况发生?

全尺寸图片:https://i.sstatic.net/N50Vg.png

I'm working on an iOS web app and I have the viewport set to not scalable via...

<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;" />

The problem is that when I focus on an input text field, it zooms in and doesn't zoom out:

enter image description here

How can I prevent this?

Full size image: https://i.sstatic.net/N50Vg.png

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

娇纵 2025-01-02 11:04:58

我认为您正在寻找的答案是:

    <meta name="viewport" content="width=device-width; intial-scale=1; maximum-scale=1">

这可以防止它扩展。

I think the answer you are looking for is:

    <meta name="viewport" content="width=device-width; intial-scale=1; maximum-scale=1">

This prevents it from scaling.

叹倦 2025-01-02 11:04:58

问题是这个标签,

-webkit-overflow-scrolling: touch;

在iOS5中确实有bug,从div中删除它后,缩放问题并没有发生再次。

The problem was this tag,

-webkit-overflow-scrolling: touch;

It's been really buggy in iOS5, and after removing it from the div, the zoom problem did not happen again.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文