gpt4 book ai didi

ios - 刷新 View 背景色

转载 作者:行者123 更新时间:2023-11-28 10:21:14 27 4
gpt4 key购买 nike

我正在以这种方式将 refreshcontrol 添加到 tableview,但是 View 的背景颜色是白色。我怎样才能将其设置为默认值?谢谢。

var refreshControl:UIRefreshControl!
refreshControl = UIRefreshControl()
refreshControl.addTarget(self, action: "refresh:", forControlEvents: UIControlEvents.ValueChanged)
tableView.addSubview(refreshControl)

enter image description here

UPD:它也不能正常工作。

最佳答案

如果您的代码在 UITableviewController 中,则不必添加 subview 。 UITableViewControllers 有一个 refreshControl 属性,所以你可以设置

self.refreshControl = UIRefreshControl()

如果你这样做了,背景颜色应该和你的tableView的背景颜色一样。如果你想要不同的颜色,你可以使用

self.refreshControl.backgroundColor = UIColor.yourColor()

关于ios - 刷新 View 背景色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34787080/

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