I want to remove a UIButton's image and replace it with a title at runtime. Although I am able to add the title to the UIButton, I am unable to remove the image. Does anyone have some advice?
Like that? [myButton setImage:nil forState:UIControlStateNormal];
Your image must be the button's background image (otherwise you would not see your title text, the image property overrides the title property I believe). So you must do:
[myButton setBackgroundImage:nil ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With