【问题标题】:Ionic - black background on rubber band effect on iOSIonic - iOS 上橡皮筋效果的黑色背景
【发布时间】:2016-11-28 18:57:43
【问题描述】:

我已经禁用了身体上的橡皮筋效果,但它仍然在内部 div 上处于活动状态,这很好。

但是,当显示滚动元素上方的部分时,背景为黑色,如图所示:

我尝试为所有父容器指定显式颜色,但似乎没有任何效果。你知道如何设置颜色吗?

【问题讨论】:

    标签: ionic-framework background-color rubber-band


    【解决方案1】:

    我有同样的问题,但背景是 img。在 android/windows 背景图像看起来不错,但在 ios 上,屏幕不知何故被黑色填充。翻遍了DOM树,终于找到了:

    .ios .ion-page.show-page ~ .nav-decor {
    top: 0;
    position: absolute;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
    background: #000;
    pointer-events: none;}
    

    所以我在 app.scss 中放了(肮脏的解决方案):

    .ios .nav-decor{background:transparent !important;}
    

    【讨论】:

      【解决方案2】:

      是的。我遇到了同样的问题。我试图设置它的样式但我失败了,因为找不到任何黑色背景的元素。我认为它来自webview。但是我发现了一个有趣的解决方法,我不知道它是否适合你。

      我的工作

      我插入了一个“ios-black-screen-fix”类的空白div

      <ion-content class="white-bg">
          <div class="ios-black-screen-fix"></div>
          ........................................
          ........................................
      </ion-content>
      

      在css中

      .ios-black-screen-fix {
          height: 1px;
      }
      

      【讨论】:

      • 工作正常!谢谢!
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-02-18
      • 1970-01-01
      • 1970-01-01
      • 2015-06-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多