tags:

views:

21

answers:

1

Hi, everyone

I have 1 UIButton with 1 image with blue colour but when i click on UIButton at that time i want to remove that image and add 1 another image.

A: 

In code you can set button image following way:

[yourButton setImage:yourImage forState:UIControlStateHighlighted]; // or for whatever state you want

You can also set all necessary images in IB for all possible states (default, highlighted and selected)

Vladimir
It's not happens when i click 1 st time it's happens 2 nd time and afterwards
Where do you set an image to your button? If you just have 1 image for each state - better set them in IB (or on view controller's initialization)
Vladimir