UIButton won't gray out

前端 未结 5 1487
后悔当初
后悔当初 2020-12-30 21:37

Isn\'t UIButton supposed to become grayish/grayer when enabled=NO ?

I have a simple UIButton on a blackbackground (no custom images, no custom nothing, just dragged

5条回答
  •  -上瘾入骨i
    2020-12-30 22:02

    There is another way without having to alpha the whole button:

    [startButton setTitleColor:[UIColor grayColor] forState:UIControlStateDisabled];
    

    Then whenever you set the enabled property to NO, the button's text will automatically gray out.

提交回复
热议问题