【问题标题】:ionic scrollbar is not visible in Android phone离子滚动条在 Android 手机中不可见
【发布时间】:2017-09-02 01:29:48
【问题描述】:

我在为 ionic 应用程序构建 android 时面临的这个问题。 虽然我尝试了许多通过以下链接获得的建议。无法解决这个问题。任何人都可以建议我更多的建议。我会给予任何帮助。

https://github.com/driftyco/ionic/issues/4928

Make scrollbar visible in ionic content when using native scroll

【问题讨论】:

  • 欢迎来到 SO!到目前为止,您实际上尝试过哪些您希望工作但没有工作的方法?它是否显示任何错误?
  • 还没有错误!!但滚动条没有反映在我的 android 应用中
  • 会不会是显示的信息不够需要滚动条?请从您的调试工具中添加图像,以帮助我们更好地了解您所看到的内容。 (编辑或创建问题时,文本框上方有一个嵌入图像功能)
  • 我必须添加 ion-scrollbar 并在其中添加 css 类以添加一些属性。成功了谢谢
  • 谢谢!!我正在分享下面对我有用的代码:) 在 html 中我添加了以下代码。
    在Css中添加以下代码-----。根{高度:250px;背景颜色:#F5F5F5; }

标签: android ionic-framework


【解决方案1】:

试试这个。将这些类放在 css 文件中:

::-webkit-scrollbar {
    -webkit-appearance: none;
}

::-webkit-scrollbar:vertical {
    width: 11px;
}

::-webkit-scrollbar:horizontal {
    height: 11px;
}

::-webkit-scrollbar-thumb {
    border-radius: 8px;
    border: 2px solid white;
    background-color: rgba(0, 0, 0, .5);
}

::-webkit-scrollbar-track {
    background-color: #fff;
    border-radius: 8px;
}

.overflow-scroll {
    overflow-y: auto !important;
}

【讨论】:

    【解决方案2】:

    为了纠正我的 Ionic 滚动条问题,我添加了以下 CSS 和 HTML。它目前在我的 android 应用程序中运行。

    在 html 文件中我添加了以下内容:

    .theroot {
        height: 250px;
        background-color: #F5F5F5;
    }
    <ion-content>
    <ion-scroll  direction="y" class="theroot">
    <div>
    </div>
    </ion-scroll>
    </ion-content>

    在 style.css 中添加如下代码

    .theroot {
        height: 250px;
        background-color: #F5F5F5;
    }
    

    【讨论】:

      猜你喜欢
      • 2015-10-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-28
      • 2017-05-11
      相关资源
      最近更新 更多