删除 tvOS 中的 UITableView 滚动指示器

Remove UITableView scroll Indicators in tvOS

问题:

如何删除 TableView 中的垂直发光滚动指示器(或更改其颜色)?

描述:

自从 UITableView is a subclass of UIScrollView 以来,我一直在努力寻找其背后的原因。 我试图通过情节提要和代码禁用滚动指示器,如下所示:

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

但他们什么也没改变。我已经进入故事板并将任何默认颜色更改为黑色。那也没用。

图片:

带有红色箭头的图像指向发光的白色滚动指示器,我想删除它或更改它的颜色。

编辑:我尝试过的:

我尝试修改:

self.tableView.contentInsets
self.tableView.scrollIndicatorInsets
self.tableView.indicatorStyle = UIScrollViewIndicatorStyle.black

大概,你要找的是self.tableView.mask View 属性:

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.

如文档所述,它是一个可选视图,只需将其设置为nil:

self.tableView.mask = nil

输出:

之前将 mask 视图设置为 nil 应该是这样的:

设置 mask 视图到 nil 后应该是这样的:

旁注:

与 iOS 相比,似乎 mask 视图是 nil - 默认情况下 - 但 不是 tvOS。我都试过了,日志输出是:

对于iOS:

nil

对于 tvOS:

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