ios - 滚动在 iPhone 上不起作用

标签 ios css iphone scroll webkit

在所有设备上滚动都有效,但在 iPhone 上无效

@media only screen and (-webkit-min-device-pixel-ratio: 0) {
@supports (-webkit-overflow-scrolling: touch) {

body {
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  -webkit-text-size-adjust:none;
  height: 1300px!important;
  position: relative!important;
  background-image: radial-gradient(circle at center , #0c505f, #053540 );
  color: #0c505f;
  width: 95%!important;
}

最佳答案

When you dynamically add content to a div with -webkit-overflow-scrolling: touch; that exceeds the div in height, it becomes broken and unscrollable. You can fix this by constantly having an inner div, that triggers the scrollbar because its 1px higher than the outer div: - (Patrick Muff)

.outer {
  overflow: scroll;
  -webkit-overflow-scrolling: touch;
  /* More properties for a fixed height ... */
}

.inner {
  height: calc(100% + 1px);
}

关于ios - 滚动在 iPhone 上不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50162478/

相关文章:

objective-c - 保存使用 NSCoder 编码的数据

ios - swift 4中导航栏的高度

javascript - 不需要的图标出现在 IE8 中的图像上

javascript - 如何从单选按钮获取文本值并将值分配给特定的 div

ios - 在类似于App Store "Description"Cell的UITableViewCell中扩展UITextView

ios - 打开具有特定地址 iOS 7 的 map

ios 自动布局约束问题

html - 带有渐变和箭头的 CSS 动态大小按钮的最佳实践

iphone - iphone 设备之间的蓝牙信号强度

iphone - 使用MKMapView时如何设置精度和距离过滤器