gpt4 book ai didi

ios - 在 UIButton 状态为 .disabled 时更改其颜色

转载 作者:可可西里 更新时间:2023-11-01 00:39:16 24 4
gpt4 key购买 nike

我试图在禁用时更改按钮图像颜色。提一下我的按钮也可能被启用

问题是它总是灰色的。

    sendCodeBtn.isEnabled = false
sendCodeBtn.setImage(#imageLiteral(resourceName: "validated_phone").withRenderingMode(.alwaysTemplate), for: .disabled)
sendCodeBtn.tintColor = Theme.defaultColor()

最佳答案

@IBAction btn : UIButton!
if btn.state == .isSelected{
btn.backgroundColor = UIColor.red
}

关于ios - 在 UIButton 状态为 .disabled 时更改其颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49517482/

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