How can I change UIButton title color?

前端 未结 5 1843
無奈伤痛
無奈伤痛 2020-12-04 09:14

I create a button programmatically..........

button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button addTarget:self action:@selector(aMethod:)
fo         


        
5条回答
  •  执念已碎
    2020-12-04 09:42

    Solution in Swift 3:

    button.setTitleColor(UIColor.red, for: .normal)
    

    This will set the title color of button.

提交回复
热议问题