Is there a way to hide the scroll indicators in a UIScrollView?

IosUiscrollview

Ios Problem Overview


I've got a use case where those indicators disturb the user interaction. Can I subclass and override a method or do something similar to remove the scroll indicators from the scroll view?

Ios Solutions


Solution 1 - Ios

Set the showsHorizontalScrollIndicator and showsVerticalScrollIndicator properties of the UIScrollView to NO.

[tableView setShowsHorizontalScrollIndicator:NO];
[tableView setShowsVerticalScrollIndicator:NO];

Documentation - UIScrollView

Solution 2 - Ios

//For UITableView - Objective-C

tbl.showsHorizontalScrollIndicator = NO;
tbl.showsVerticalScrollIndicator = NO;

//For UITableView - SWIFT 3.0

tbl.showsHorizontalScrollIndicator = false
tbl.showsVerticalScrollIndicator = false

//For UIScrollView - Objective-C

scrl.showsHorizontalScrollIndicator = NO;
scrl.showsVerticalScrollIndicator = NO;

//For UIScrollView - SWIFT

scrl.showsHorizontalScrollIndicator = false
scrl.showsVerticalScrollIndicator = false

Change from XIB or storyboard

enter image description here

Solution 3 - Ios

For those looking to do this in Swift.

self.tableView.showsHorizontalScrollIndicator = false
self.tableView.showsVerticalScrollIndicator = false

Solution 4 - Ios

For UIScrollView in Swift

scrollView?.showsHorizontalScrollIndicator = false
scrollView?.showsVerticalScrollIndicator = false

Solution 5 - Ios

Swift 3.0 extension for UIScrollView and UITableView:

import Foundation

extension UIScrollView {
    func hideIndicators() {
        showsHorizontalScrollIndicator = false
        showsVerticalScrollIndicator = false
    }
}

Solution 6 - Ios

These are your UITableView scrolling properties:

[YourTableView setShowsHorizontalScrollIndicator:NO];
[YourTableView setShowsVerticalScrollIndicator:NO];

These are your UIScrollView scrolling properties:

[YourScroll setShowsHorizontalScrollIndicator:NO];
[YourScroll setShowsVerticalScrollIndicator:NO];

Solution 7 - Ios

No answers have worked for me because the focus ring of indicators is shown every time but I solve my problem via NSStoryboard.

NSCollectionView have a diagram;

Scroll View - Collection View then Clip View then Scroller (vertical) & Scroller (Horizontal)

enter image description here

Click any Scroller object then in Attributes Inspector set Focus Ring property to None. If you have not set it you can have a problem when users change the Appearance between Dark and Light.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionThanksView Question on Stackoverflow
Solution 1 - IosretainCountView Answer on Stackoverflow
Solution 2 - IosBhavesh NayiView Answer on Stackoverflow
Solution 3 - IosdavidrayowensView Answer on Stackoverflow
Solution 4 - IosmattyUView Answer on Stackoverflow
Solution 5 - IosRoman BarzyczakView Answer on Stackoverflow
Solution 6 - IosDarshan KunjadiyaView Answer on Stackoverflow
Solution 7 - IoseemrahView Answer on Stackoverflow