Ionic 4: how to hide ScrollBar in ion-content

问题: Im trying to hide the scroll-bar in ion-content (Ionic 4) there's no ion-scroll on ionic 4 so I used the ion-content but I can't find any css attribute to hide it (most of...

问题:

Im trying to hide the scroll-bar in ion-content (Ionic 4) there's no ion-scroll on ionic 4 so I used the ion-content but I can't find any css attribute to hide it (most of them not work)

I do want to scroll but I don't want to see the scrollbar

::-webkit-scrollbar,
*::-webkit-scrollbar {
  display: none;
}

I've tried it but it doesn't work in ion-content.. thanks alot.


回答1:

create classname where you want to hide scroll on page

<ion-content class="no-scroll">

after that in app.scss file write code

.no-scroll .scroll-content{
    overflow: hidden;
}

回答2:

Disable scrolling on the vertical axis with:

<ion-content scrollY="false">
</ion-content>

Docs: https://beta.ionicframework.com/docs/api/content

  • 发表于 2019-01-22 17:29
  • 阅读 ( 254 )
  • 分类:网络文章

条评论

请先 登录 后评论
不写代码的码农
小编

篇文章

作家榜 »

  1. 小编 文章
返回顶部
部分文章转自于网络,若有侵权请联系我们删除