ScrollView.refreshControl = refreshControl 不显示自定义设置。函数执行,但无显示反馈

ScrollView.refreshControl = refreshControl does not show custom settings. Function executes, but no display feedback

我有一个包含 3 个集合视图的 ScrollView。我实施了刷新控制。刷新控件在触发所需功能的意义上正确运行 - 甚至延迟下拉滚动视图。

但是,当我像这样将刷新控件添加到我的 scrollView 时,设置任何 refreshControls 属性(例如 text/background 颜色)都没有效果:

scrollView.refreshControl = refreshControl

当我使用旧方法时:

scrollView.insertSubview(refreshControl, at: 0)

我可以看到 text/spinner,但它有问题。

在不使用 insertSubview 时,refreshControl 的属性可能会从视图中隐藏,是否有原因?

感谢一位名叫 Matt 的用户回答了这个问题: UIRefreshControl not showing in landscape when in a navigation controller with large titles

我能够确定这确实是由大标题首选引起的:故事板中为我的导航标题自动设置。即使我的导航栏隐藏在视图控制器上,它隐藏我的 refreshControl 的不良影响仍然存在。要解决这个问题,正如 Matt 所说:

"If you turn off Prefers Large Titles everything is fine. I've played with some other settings, but no effect."