UIRefreshControl仅为iPhone 6调用刷新功能

时间:2017-09-05 06:48:22

标签: ios swift uirefreshcontrol iphone-6

以下是viewDidLoad

中下拉刷新的代码
refreshControl = UIRefreshControl()
refreshControl.tintColor = UIColor.blue
refreshControl.attributedTitle = NSAttributedString(string: "Loading")
refreshControl.addTarget(self, action: #selector(self.refresh), for: UIControlEvents.valueChanged)

if #available(iOS 10.0, *) {
    scrollview.refreshControl = refreshControl
} else {
    scrollview.addSubview(refreshControl)
}

这是我的刷新功能

func refresh() {
print("Pull down refresh called")
}

除了iPhone 6以外,所有设备都可以正常使用。 我已经使用iPhone 6模拟器-iOS 10.3进行了测试 问题是什么?以及如何解决这个问题?

0 个答案:

没有答案