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.
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
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];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With