How can I change UIButton title color?

前端 未结 5 1833
無奈伤痛
無奈伤痛 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:53

    If you are using Swift, this will do the same:

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

    Hope that helps!

提交回复
热议问题