How to hide scroll bar of UICollectionView

后端 未结 3 2081
野趣味
野趣味 2020-12-29 19:32

I m working on a UICollectionView class, and it will display the scroll bar when I scroll on the list, it\'s possible to hide scroll bar when scrolling?

相关标签:
3条回答
  • 2020-12-29 19:58

    in Swift:

    collectionView.showsHorizontalScrollIndicator = false
    

    in Interface Builder:

    0 讨论(0)
  • 2020-12-29 20:01

    Objective C:

     [collectionView setShowsHorizontalScrollIndicator:NO];
     [collectionView setShowsVerticalScrollIndicator:NO];
    

    Swift 3.0

    colView.showsHorizontalScrollIndicator = false
    colView.showsVerticalScrollIndicator = false
    

    From storyboard:

    0 讨论(0)
  • 2020-12-29 20:16

    Option #1 (by code):

    myCollectionView.showsVerticalScrollIndicator = false
    myCollectionView.showsHorizontalScrollIndicator = false
    

    Option #2 (from storyboard):

    Go to Attributes inspector > Uncheck "Show Horizontal Indicator" and "Show Vertical Indicator"

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