gpt4 book ai didi

objective-c - 按钮边框颜色 - Objective C - Swift

转载 作者:可可西里 更新时间:2023-11-01 01:02:31 26 4
gpt4 key购买 nike

我想将我的边框颜色更改为特定的十六进制颜色(#21CE99),你们能帮帮我吗?

我已经知道如何将其更改为基本颜色,例如:

_button.layer.borderColor = [UIColor greenColor].CGColor;

但我只需要这个颜色。

谢谢。

回答

How to set the custome border color of UIView programmatically in swift

最佳答案

使用 SWIFT 4 的人的正确答案是:

_button.layer.borderColor = UIColor(red: 33/255, green: 206/255, blue: 153/255, alpha: 1.0).cgColor

内置 UIColors 预设或您自己的颜色:

_button.layer.borderColor = UIColor.blue.cgColor

关于objective-c - 按钮边框颜色 - Objective C - Swift,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34196547/

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