ios - 刷新控件 - 显示在电视上方

标签 ios swift uitableview uirefreshcontrol

我想问一下如何在 TV 单元格下显示 UIActivityControl。这就是它现在的显示方式。谢谢

(self.tableView.refreshControl = self.refreshControl 不起作用)

代码:

override func viewDidLoad() {
    super.viewDidLoad()

    self.refreshControl = UIRefreshControl()
    self.refreshControl.attributedTitle = NSAttributedString(string: "Aktualizace")
    self.refreshControl.addTarget(self, action: "refresh:", forControlEvents: UIControlEvents.ValueChanged)
    self.view.addSubview(self.refreshControl)
    self.view.bringSubviewToFront(self.tableView)
}

enter image description here

最佳答案

您不需要 refresh_control 成员,也不需要将 refresh_control 添加为 subview 。

UITableViewController 有一个 refreshControl 成员。

试试这个:

self.refreshControl = UIRefreshControl()
self.refreshControl.attributedTitle = NSAttributedString(string: "Aktualizace")
self.refreshControl.addTarget(self, action: "refresh:", forControlEvents: UIControlEvents.ValueChanged)

关于ios - 刷新控件 - 显示在电视上方,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33136577/

相关文章:

ios - Swift 从中获取最大键并排序

ios - HTTP DELETE 在浏览器中有效,但在 Postman 或 IOS 应用程序中无效

ios - (iPhone)如何在TableView中仅更新一行

android - 如何在 Xamarin.Forms 中制作具有通用页眉和页脚的轮播页面

iphone - 无法读取新 iPhone 的符号,适用于运行 iOS 5 的 iPad

ios - 通过选择对象和颜色匹配来裁剪图像

ios - 使用 Swift 5.1 编译的模块无法被 Swift 5.1.2 编译器导入

ios - 自定义 iPhone 框架的 Mach-O 类型应该是什么?

ios - Segue传递数据后如何重新加载tableView数据

ios - 如何在 UITableView 上只圆角?