How can I disable or hide the scrollbar within an Ionic 2

前端 未结 9 1392
轻奢々
轻奢々 2020-12-03 10:02

I have an Angular 2 app wrapped in Ionic 2. I\'m using , and within each tab is an . The content in this area ne

相关标签:
9条回答
  • 2020-12-03 10:43

    Add this css into your styles,

    I fetched this class from inspect element which contains scrollbar and items

    ion-scroll.scroll-y .scroll-content::-webkit-scrollbar{
      display: none;
    }
    

    worked for me

    0 讨论(0)
  • 2020-12-03 10:44

    I am using Ionic 2 rc 0

    My solution is to use an ion-fixed attribute on a div I called envelope.

    (in rc 0, you can't add ion-fixed to ion-content)

    <ion-content>
      <div id='envelope' ion-fixed>
      </div>
    </ionic-content>
    
    #envelope{
      width: 100%;
      min-height: 100%;
      padding: 0;
      margin: 0;
      height: 100%;
      overflow: hidden;
    }
    
    0 讨论(0)
  • 2020-12-03 10:45

    In ionic2 I saw overflow-y is set to scroll by default so in your src/app/app.scss file try this:

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

    This will hide scroll bar from every view and also enable scrolling when it has content.

    0 讨论(0)
提交回复
热议问题