Refresh Control - showing above TV

人盡茶涼 提交于 2019-12-12 02:47:11

问题


I'd like to ask you how can I show UIActivityControl under TV cells. This is how it's showed right now. Thanks

(self.tableView.refreshControl = self.refresh_control doesn't work)

Code:

override func viewDidLoad() {
    super.viewDidLoad()

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


回答1:


You don't need the refresh_control member, nor do you need to add refresh_control as a subView.

UITableViewController has a refreshControl member.

Try this:

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


来源:https://stackoverflow.com/questions/33136577/refresh-control-showing-above-tv

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!