Ionic 2 disable scroll

前端 未结 9 1163
暗喜
暗喜 2021-02-03 21:00

I\'ve tried several methods to disable scroll, including using CSS position: fixed, attribute overflow-scroll=\"false\" and etc, but all methods failed

相关标签:
9条回答
  • 2021-02-03 21:48

    Content is placed in the scrollable area if provided without a slot. To show a fixed content add slot="fixed".

    <ion-content>
    <div slot="fixed">
    
    </div>
    </ion-content>
    
    0 讨论(0)
  • 2021-02-03 21:51

    This works in ionic 5:

    ion-content {
       --overflow: hidden;
    }
    
    <ion-content scroll-y="false">
    
    0 讨论(0)
  • 2021-02-03 21:52

    Tested with ionic 3 (should work on ionic 2):

    <ion-content no-bounce></ion-content>
    
    0 讨论(0)
提交回复
热议问题