Why is my UIButton.tintColor not working?

后端 未结 13 1079
长情又很酷
长情又很酷 2020-12-03 04:15

My build target is set for IOS5 which is where I understand UIButton.tintColor was introduced...

I have this in my viewDidLoad for the View Controller

13条回答
  •  死守一世寂寞
    2020-12-03 05:04

    To change the color of the Button text you can use:

    resetButton.setTitleColor(UIColor.blackColor(), forState: .Normal)
    

    Or OBJ-C:

    - (void)setTitleColor:(UIColor *)color
             forState:(UIControlState)state
    

    https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIButton_Class/#//apple_ref/occ/instm/UIButton/setTitleColor:forState:

提交回复
热议问题