我正在使用 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?
Position:fixed 在版本 5 之前的 iOS 和其他一些移动浏览器上不起作用.有很多解决方案,但我个人可以推荐的一个是由 Nitobi 编写的 GloveBox拥有 Jesse MacFadyen.它允许您定义可滚动的区域,我相信在您的情况下这将是主要内容,而顶部栏不可滚动.这种方法的另一个优点是,用户将无法像移动 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 中修复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!