UIButton title text color

后端 未结 5 1940
刺人心
刺人心 2020-12-04 10:47

I\'m setting text color for UIButton

headingButton.titleLabel.textColor = [UIColor colorWithRed:36/255.0 
                                               


        
5条回答
  •  情书的邮戳
    2020-12-04 11:02

    swift 5 version:

    By using default inbuilt color:

    1. button.setTitleColor(UIColor.green, for: .normal)

    OR

    You can use your custom color by using RGB method:

    1. button.setTitleColor(UIColor(displayP3Red: 0.0/255.0, green: 180.0/255.0, blue: 2.0/255.0, alpha: 1.0), for: .normal)

提交回复
热议问题