Button border color - Objective C - Swift

前端 未结 3 491
别跟我提以往
别跟我提以往 2021-01-20 09:08

I want to change my border color to a specific hex color(#21CE99), can you guys please help me?

I\'ve already known how to change it to a basic color, for example:

3条回答
  •  清歌不尽
    2021-01-20 09:28

    The correct answer for people using SWIFT 4 would be:

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

    Built-In UIColors Presets or your own colors:

    _button.layer.borderColor = UIColor.blue.cgColor
    

提交回复
热议问题