从风景到肖像时如何解决视口问题 [英] how to fix Viewport issue when going from landscape to portrait

查看:93
本文介绍了从风景到肖像时如何解决视口问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在研究iPod和iPhone 4的Safari中的视口问题,但是我找不到任何答案. 关于肖像的问题有多个主题,而从肖像到肖像则没有. 问题如下:

I've been doing some research about viewport issues in iPod and iPhone 4's Safari, but i can't find any answer on this matter. There are several threads about issues going from portrait to landscape, but not from landscape to portrait. The issue is the following:

从纵向到横向时,我通常会遇到正常的缩放问题,所以我添加了标签:

I used to have the normal zooming issue when going from portrait to landscape so i added the tag:

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

因此解决了该问题. 现在,当我回到纵向模式时,我制作的页面会被拉伸,并以增加的右边距呈现.这会使页面变宽,因此您必须向左扫动以获取页面的原始位置(以确保保留新的右边距").

So that fixed that issue. NOW, when I go back to portrait mode, the page I made gets streched and it renders with an added right margin. This makes the page wider, so you have to sweep to the left to get the original position of the page (thought it keeps the new 'right margin').

对不起,如果有人已经回答了这个问题,但是我似乎找不到对此问题的任何回应.

Sorry if there was someone that already answered this, but i just couldn't seem to find any response to this issue.

让我知道是否需要其他信息. 请记住,这是我的第一个问题:/

Let me know if some additional information is required. Please keep in mind it's my first question :/

谢谢!

我正在运行iOS 6,并且遇到此问题.当我在iOS 5.1.1上运行页面时,它可以正确显示,因此它可能是以前修复的视口错误的新版本.

I'm running iOS 6, and getting this issue. When i run my page on an iOS 5.1.1 it displays properly, so it might be a new version of the viewport bug that was fixed before.

推荐答案

我认为您要将其添加到CSS或样式块中. (这是在此帖子中)

I think you want to add this to your CSS or style block. (It was in this post)

  html {
      -webkit-text-size-adjust: none; /* Never autoresize text */
  }

这篇关于从风景到肖像时如何解决视口问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆