Fix position:fixed in iOS 4(修复位置:在 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?
推荐答案
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 中修复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:修复位置:在 iOS 4 中修复
基础教程推荐
- Android Volley - 如何动画图像加载? 2022-01-01
- iOS - UINavigationController 添加多个正确的项目? 2022-01-01
- 如何将图像从一项活动发送到另一项活动? 2022-01-01
- 如何比较两个 NSDate:哪个是最近的? 2022-01-01
- navigationItem.backBarButtonItem 不工作?为什么上一个菜单仍然显示为按钮? 2022-01-01
- 为什么姜饼模拟器方向卡在应用程序中? 2022-01-01
- Play 商店的设备兼容性问题 2022-01-01
- Xcode UIView.init(frame:) 只能在主线程中使用 2022-01-01
- UIImage 在开始时不适合 UIScrollView 2022-01-01
- SwiftUI-ScrollViewReader的ScrollTo不滚动 2022-01-01
