Hello In IB I've used a rectangle button, once u press that button and hold, it goes a grey colour - I want to change that g开发者_开发知识库rey colour to an image i made.
So once the user touches the button, it goes to the image which I made
Thanks
Set the selected state image for the button to the image that you have created:
[self.btnMybutton setImage:[UIImage imageNamed:@"gray.png"] forState:UIControlStateSelected];
In Interface Builder you can set an image for each state of the button. Simply click where it says "Default State Configuration" in the inspector and select "Highlighted State Configuration". Set the image you want in the "Image" or "Background" field and the button will use that image when it's touched.
精彩评论