【问题标题】:ion-content scrolling stopped working on ios 14离子内容滚动在 ios 14 上停止工作
【发布时间】:2020-09-24 19:49:31
【问题描述】:

iOS 14.0 更新后,我的应用在某些屏幕上停止工作,当我在 13.5 模拟器上测试时,它可以正常工作。

我已经在使用下面的代码了:

ion-app.platform-ios12 ion-content {
   pointer-events: auto; / * fix scroll lock on ios12.2 * /
}

我也尝试通过css强制屏幕滚动,但没有消息:(

有没有人遇到过类似的情况?任何线索都会有所帮助! 我的设置:

Ionic:
   Ionic CLI                     : 6.11.8 
   @angular/cli                  : 8.1.3
Capacitor:
   Capacitor CLI   : 2.4.2
   @capacitor/core : 2.4.2
System:
   npm    : 6.14.8
   OS     : macOS Catalina

【问题讨论】:

    标签: ios ionic-framework ionic3 ionic4 capacitor


    【解决方案1】:

    您需要像这样更新代码以指向 iOS 14

    ion-app.platform-ios14 ion-content { pointer-events: auto; }

    【讨论】:

      【解决方案2】:

      伙计们,我已经弄清楚了,显然我的项目包含一个 SCSS 类,该类在以下项目中存在问题:

      .background {
        background: #f2f2f2;
        top: 0;
        position: absolute;
        overflow: hidden;
        z-index: -1; <--------------- PROBLEM
        transition-property: none;
        transform: translateX(0%) translateY(0px);
      }
      

      去掉 top: 0 和 z-index 后,屏幕的滚动恢复工作。 我发现最奇怪的是,在 iOS 13.x 版本中它运行良好。但是好吧,重要的是它再次起作用了;)

      【讨论】:

      • 谢谢。我删除了 z-index: -1 并在 14 年开始工作
      【解决方案3】:

      这适用于 Ionic 3 项目

      variables.scss

      ion-app.platform-ios14 ion-content { 
                pointer-events: auto !important;
      }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-11-28
        • 1970-01-01
        • 2018-08-03
        • 2016-09-10
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多