固定位置:在iOS 4中固定 [英] Fix position:fixed in iOS 4

查看:163
本文介绍了固定位置:在iOS 4中固定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用PhoneGap HTML / CSS构建一个小应用程序。现在我的问题是 position:fixed (用于顶部栏)适用于iOS 5,但不是在iOS 4。有人知道这个修复?

I am building a small app using PhoneGap HTML/CSS. Now my problem is that position:fixed (used on a top bar) works on iOS 5 but not on iOS 4. Someone knows a fix for this?

推荐答案

位置:固定在iOS 5之前的版本和一些其他移动浏览器不工作。这里有很多解决方案,但我可以亲自推荐的是 GloveBox 由Nitobi的自己的杰西MacFadyen。它允许你定义可滚动的区域,我相信你的情况将是主要内容,而顶部栏不可滚动。
此方法的另一个优点是,用户无法滚动您的应用程序的视图,就像它是一个正常的网站在Mobile Safari上。

Position:fixed doesn't work on iOS before version 5 and some other mobile browsers. There are a lot of solutions out there for this, but one that I can personally recommend is GloveBox written by Nitobi's own Jesse MacFadyen. It lets you define areas that are scrollable, and I believe in your case that would be the main content, while the top bar isn't scrollable. Another advantage of this approach is that the user won't be able to "scroll out" of your app's view as if it were a normal website on Mobile Safari.

这篇关于固定位置:在iOS 4中固定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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