gpt4 book ai didi

colors - 快速更改拉动以刷新文本颜色

转载 作者:搜寻专家 更新时间:2023-10-31 21:53:55 24 4
gpt4 key购买 nike

我有一个拉动来刷新我的应用程序。

如何更改 attributedTitle 的文本颜色?

 refresher.attributedTitle = NSAttributedString(string: "hey ! is there something new ?")

最佳答案

尝试

var attr = [NSForegroundColorAttributeName:UIColor.greenColor()]
refresher.attributedTitle = NSAttributedString(string: "hey ! is there something new ?", attributes:attr)

最新的 Swift 5.6

var attr = [NSAttributedString.Key.foregroundColor: UIColor.white]
refresher.attributedTitle = NSAttributedString(string: "hey ! is there something new ?", attributes:attr)

关于colors - 快速更改拉动以刷新文本颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25823063/

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