有没有办法使用`someButton.enabled = NO;`而不调暗自定义图像UIButton?

han*_*Dev 1 iphone objective-c uibutton ios

有没有办法使用someButton.enabled = NO;而不调暗自定义图像UIButton

我想在没有启用iOS的情况下更改图像=没有效果.

Ram*_*uri 5

启用按钮时,将禁用按钮的图像设置为等于图像:

UIImage* image=[button imageForState: UIControlStateNormal];
[button setImage: image forState: UIControlStateDisabled];
Run Code Online (Sandbox Code Playgroud)