Reputation: 1245
i have this code in the button click to show selection image when the button is clicked
UIImage *img1 = [UIImage imageNamed:@"settingpress.png"];
[_btnclick setImage:img1 forState:(UIControlStateHighlighted+UIControlStateSelected)];
[img1 release];
but i didn't get the image ,my button is a UIButton in xib with custom button not the Roundrect.what is the error in my code. thanks in advance.
Upvotes: 0
Views: 62
Reputation: 20410
You have to use background Image and the | separator:
[_btnclick setBAckgroundImage:img1 forState:(UIControlStateHighlighted|UIControlStateSelected)];
Upvotes: 1