gpt4 book ai didi

ios - 淡出 UIRefreshControl 或将其从透明 ScrollView 中隐藏

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:05:08 25 4
gpt4 key购买 nike

我想从我的透明 ScrollView 中隐藏我的 UIRefreshControl 比平时更快,并快速淡出,这样它就不会与文本重叠。任何类似的解决方案将不胜感激!

let refreshControl = UIRefreshControl()

refreshControl.tintColor = UIColor.white
let color = [NSAttributedStringKey.foregroundColor: UIColor.white]
refreshControl.attributedTitle = NSAttributedString(string: "Pull to refresh", attributes: color)
refreshControl.addTarget(self, action: #selector(refreshData), for: .valueChanged)
scrollView.refreshControl = refreshControl

@objc func refreshData(refreshControl: UIRefreshControl) {

updateBitcoinValueLabel()
updateBitcoinCashValueLabel()
updateEthereumValueLabel()
updateLitecoinValueLabel()
updateRippleValueLabel()
updateWalletValueLabel()

refreshControl.endRefreshing()
}

+ Example

你们有什么想法吗?

最佳答案

你可以试试这个

override func scrollViewWillEndDragging(_ scrollView: UIScrollView, 
withVelocity velocity: CGPoint,
targetContentOffset: UnsafeMutablePointer<CGPoint>)
{
self.refreshControl.isHidden = true

}

关于ios - 淡出 UIRefreshControl 或将其从透明 ScrollView 中隐藏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48308943/

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