gpt4 book ai didi

swift - 删除 tvOS 中的 UITableView 滚动指示器

转载 作者:可可西里 更新时间:2023-11-01 00:02:34 26 4
gpt4 key购买 nike

问题:

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

描述:

UITableView is a subclass of UIScrollView我一直在努力寻找背后的原因。我试图通过 Storyboard和如下代码禁用滚动指示器:

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

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

图片:

image showing the glowing scroll indicator带有红色箭头的图像指向发光的白色滚动指示器,我想将其移除或更改其颜色。

编辑:我尝试过的:

我试图修改:

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

最佳答案

您可能正在寻找的是 self.tableView.ma​​sk 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.

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

self.tableView.mask = nil

输出:

之前mask View 设置为nil应该是这样的:

enter image description here

mask View 设置为 nil 后应该是这样的:

enter image description here

旁注:

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

对于 iOS:

nil

对于 tvOS:

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

关于swift - 删除 tvOS 中的 UITableView 滚动指示器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40871918/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com