Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

People also ask

How do I hide the scroll indicator in react native?

React Native ScrollView and FlatList default show indicator on right and bottom when use scroll view. React Native ScrollView and FlatList provide showsVerticalScrollIndicator and showsHorizontalScrollIndicator to hide or remove scroll indicator and both are true default, we have to pass as false to hidel scrollbar.

How do I hide scroll overflow?

To hide the horizontal scrollbar and prevent horizontal scrolling, use overflow-x: hidden: HTML.


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

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

Documentation - UIScrollView


//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


For those looking to do this in Swift.

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

For UIScrollView in Swift

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

Swift 3.0 extension for UIScrollView and UITableView:

import Foundation

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

These are your UITableView scrolling properties:

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

These are your UIScrollView scrolling properties:

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