This is a long shot but I'm hoping there's a way to stop IPhones from resizing a page on load. Problem is if it's a site with a lot of need for refreshing (Say a forum) it gets a little old for users to have to resize that page every refresh.
这是一个很长的镜头,但我希望有一种方法可以阻止IPhones在加载页面时调整大小。问题是,如果它是一个需要刷新的网站(说一个论坛),那么用户必须在每次刷新时都必须调整该页面的大小。
Is there a way to force Safari/The IPhnone to not minimize the site on refresh that doesn't involve a user changing a setting?
是否有办法强制Safari / IPhnone不会最小化刷新时不涉及用户更改设置的网站?
1 个解决方案
#1
There is a meta tag you can use that will constrain the viewport for the iPhone:
您可以使用一个元标记来约束iPhone的视口:
<meta name="viewport" content="width=320" />
From Apple's developer documentation:
来自Apple的开发者文档:
Use the
viewport
meta tag to improve the presentation of your web content on iPhone. Typically, you use the viewport meta tag to set the width and initial scale of the viewport. For example, if your webpage is narrower than 980 pixels, then you should set the width of the viewport to fit your web content. If you are designing an iPhone-specific web application, then set the width to the width of the device.使用视口元标记可以改善iPhone上的Web内容的呈现。通常,您使用视口元标记来设置视口的宽度和初始比例。例如,如果您的网页窄于980像素,则应设置视口的宽度以适合您的网页内容。如果要设计特定于iPhone的Web应用程序,请将宽度设置为设备的宽度。
There is a constant you can use for the iPhone's device width: width=device-width
.
您可以使用常量来设置iPhone的设备宽度:width = device-width。
Not sure if this link will work, but you can read more about Mobile Safari and the viewport tag on the Apple Developer website
不确定此链接是否有效,但您可以在Apple Developer网站上阅读有关Mobile Safari和viewport标签的更多信息
#1
There is a meta tag you can use that will constrain the viewport for the iPhone:
您可以使用一个元标记来约束iPhone的视口:
<meta name="viewport" content="width=320" />
From Apple's developer documentation:
来自Apple的开发者文档:
Use the
viewport
meta tag to improve the presentation of your web content on iPhone. Typically, you use the viewport meta tag to set the width and initial scale of the viewport. For example, if your webpage is narrower than 980 pixels, then you should set the width of the viewport to fit your web content. If you are designing an iPhone-specific web application, then set the width to the width of the device.使用视口元标记可以改善iPhone上的Web内容的呈现。通常,您使用视口元标记来设置视口的宽度和初始比例。例如,如果您的网页窄于980像素,则应设置视口的宽度以适合您的网页内容。如果要设计特定于iPhone的Web应用程序,请将宽度设置为设备的宽度。
There is a constant you can use for the iPhone's device width: width=device-width
.
您可以使用常量来设置iPhone的设备宽度:width = device-width。
Not sure if this link will work, but you can read more about Mobile Safari and the viewport tag on the Apple Developer website
不确定此链接是否有效,但您可以在Apple Developer网站上阅读有关Mobile Safari和viewport标签的更多信息