Reputation: 2287
I can "fix" the problem with simple if and not changing the frame if there is no image.. but I want to make sure I'm not missing something.
I had a bug when the image in the button was not clear after setting it to nil, but it happen only in some cases.
After debugging I saw that if I change the frame after I set the image with nil, that Image still appear.
Is there a way to clear the image in the UIButton, that will clear the image no matter what ?
thanks.
Upvotes: 0
Views: 523
Reputation: 3011
do this.
if[myButton imageForState:UIControlStateNormal]!=nil)
{
[myButton setImage:nil forState:UIControlStateNormal];
}
Upvotes: 1