3

Question:

How do I remove the vertical glowing scroll indicators in a TableView (or to change it's color) ?

Description:

Since UITableView is a subclass of UIScrollView I've been trying to find the cause behind it. I've attempted to disable the scrolling indicators via the storyboard and via code like so:

//Where self is my TableViewController
self.tableView.showsVerticalScrollIndicator = false

but they have changed nothing. I've already gone in the storyboard and changed any default color to black. That didn't work either.

Image:

image showing the glowing scroll indicator Image with red arrows pointing to the glowing white scroll indicator that I would like to remove OR to change it's color.

Edit: What I've tried:

I've attempted to modify:

self.tableView.contentInsets
self.tableView.scrollIndicatorInsets
self.tableView.indicatorStyle = UIScrollViewIndicatorStyle.black
kemicofa ghost
  • 14,587
  • 5
  • 63
  • 112
  • One hackish way of doing this is might be making sure your table's frame is bigger then it's container (which must have `clipToBounds` set to true) by an amount that would hide the fading part and then adding the same amount of offset to the `contentInset.bottom` and/or `contentInset.top`. – Mihai Fratu Dec 04 '16 at 11:17
  • @MihaiFratu I went ahead and tried that, did not seem to work. – kemicofa ghost Dec 05 '16 at 08:06

1 Answers1

8

Probably, what are you looking for is the self.tableView.mask View property:

An optional view whose alpha channel is used to mask a view’s content. The view’s alpha channel determines how much of the view’s content and background shows through. Fully or partially opaque pixels allow the underlying content to show through but fully transparent pixels block that content.

As the documentation says, it is an optional view, just set it to nil:

self.tableView.mask = nil

Output:

Before setting mask view to nil should be like:

enter image description here

After setting mask view to nil should be like:

enter image description here

Aside bar note:

Comparing with iOS, it seems that the mask view is nil -by default-, but not with tvOS. I tried both of them and the log outputs were:

For iOS:

nil

For tvOS:

Optional(<_UIScrollViewGradientMaskView: 0x7ff078c037f0; frame = (-90 -40; 1101 1200); userInteractionEnabled = NO; layer = >)

Ahmad F
  • 26,570
  • 13
  • 76
  • 124