I could only find if one wants to display scroll bar or not using
tableView.showsVerticalScrollIndicator = YES/NO;
but how can I customize
I did'n find any other way but this:
UITableView *v;
[v setIndicatorStyle:<#(UIScrollViewIndicatorStyle)#>];
There is only 3 available styles. If only you will find the way to implement your own UIScrollViewIndicatorStyle, but I can't even imagine HOW to do this: they are implemented deep in UIKit framework (declared in UIScrollView.h), and you can only set a flag, witch will used by UIScrollView to know, what style to use. So, I can't see any other way: you will need somehow to implement new style and flag there. Is it possible at all?
You can hide the original scroll bar and scroll using your custom scroll bar.
– (void)setContentOffset:(CGPoint)contentOffset animated:(BOOL)animated
can be used to scroll content, just add your custom bar to the table.
For Swift 3
collectionView.indicatorStyle = UIScrollViewIndicatorStyle.white
change indicator color with 3 default color style.
TextField.indicatorStyle=UIScrollViewIndicatorStyleWhite;
You can change the scroll indicator color using:
tableView.indicatorStyle=UIScrollViewIndicatorStyleWhite;
Hope this helps.
Swift-3,4
If you are not able to override method "scrollViewDidScroll" (may be you are using this for some other functionality, or paging), Try this !!
func setScrollIndicatorColor(color: UIColor) {
for view in self.tableView.subviews {
if view.isKind(of: UIImageView.self),
let imageView = view as? UIImageView,
let _ = imageView.image {
imageView.image = nil
view.backgroundColor = color
}
}
self.tableView.flashScrollIndicators()
}
in viewDidAppear() you can call this method.