Just having some hard time with UIButton. I remove all subviews using
for (UIView *v in button.subviews) {
[v removeFromSuperview];
}
But I want to set the background image afterwards using
[button setBackgroundImage:[UIImage imageNamed:@"backgroundImage.png"] forState:UIControlStateNormal];
and nothing happens. If I do not remove all subviews than the previous code works.
So is it possivle that removing all subviews actually removes the backgroundImage as well, in which case, is it possible to put the backgroundImage back in?