iPad Safari中的可用区域有多大 [英] How large is the usable area in iPad Safari

查看:156
本文介绍了iPad Safari中的可用区域有多大的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为iPad开发一个Web应用程序,以便在Safari中运行。我还没有iPad可以测试。有没有人知道可用的屏幕大小 - 在safari / ipad控件的任何空间占用后?

I'm developing a web app for the iPad, to run in Safari. I don't yet have an iPad to test on. Does anyone know the usable screen size - after any space for the safari/ipad controls is takes up?

推荐答案

你应该关注 TN2262 并编写维度不变的代码。

You should just follow TN2262 and write dimension-invariant code.

如果您需要逻辑像素大小, document.body.client [宽度|高度] 总是980&次; 1208。

In case you need a logical pixel size, document.body.client[Width|Height] is always 980×1208.

就可以使用的绝对像素而言,Mobile Safari的导航栏占用大约78px,所以在纵向方向上它是768× 946,在横向方向上它是1024× 690。

In terms of absolute pixels you can use, the navigation bar of Mobile Safari takes up roughly 78px, so in portrait orientation it is 768×946, and in landscape it is 1024×690.

可以有一个键盘(纵向为308px,横向为397px)。

There can be a keyboard (308px in height in portrait, 397px in landscape) as well.

更新:以上绝对数字仅适用于iOS 4.x或更早版本。在iOS 5.x Apple中引入了标签栏,它将导航栏+状态栏的高度增加到96px。实际上,即使在iOS 5.x之前,书签栏的存在也会影响视口。

Update: The above absolute numbers are correct only for iOS 4.x or before. In iOS 5.x Apple introduced the tab bar which increases the height of navigation bar + status bar to 96px. Actually, even before iOS 5.x, the presence of the bookmark bar can affect the viewport as well.

这篇关于iPad Safari中的可用区域有多大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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