UIButton title text color

后端 未结 5 1916
刺人心
刺人心 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:18

    In Swift:

    Changing the label text color is quite different than changing it for a UIButton. To change the text color for a UIButton use this method:

    self.headingButton.setTitleColor(UIColor(red: 107.0/255.0, green: 199.0/255.0, blue: 217.0/255.0), forState: UIControlState.Normal)
    

提交回复
热议问题