Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide scroll bar of UICollectionView

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?

like image 994
TIANLAOBA Avatar asked Jun 15 '15 02:06

TIANLAOBA


Video Answer


3 Answers

Objective C:

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

Swift 3.0

colView.showsHorizontalScrollIndicator = false
colView.showsVerticalScrollIndicator = false

From storyboard:

enter image description here

like image 187
Tejas Ardeshna Avatar answered Oct 12 '22 09:10

Tejas Ardeshna


in Swift:

collectionView.showsHorizontalScrollIndicator = false

in Interface Builder: enter image description here

like image 13
rgreso Avatar answered Oct 12 '22 08:10

rgreso


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"

like image 3
Osama Remlawi Avatar answered Oct 12 '22 09:10

Osama Remlawi