Alex Rivera | Logout

programmatically highlight UIBarButtonItem

Asked 2011-11-25T10:33:43.100
18

after tapping the 'record' BarButtonItem I would like to keep it programmatically highlighted until the recording is over. The highlighting graphics of iOS are very good, therefor I would like to remain or set that state.

Up to now I found 'setSelected' and 'setHighlighted' but these do not work on a UIBarButtonItem. Any suggestions on how to solve this? Thank you in advance, Koen.

Edit
Report

1 Answer

-2

You can use two images for the two states of the button like for one state "UIControlStateNormal" you can use an image for the normal condition.

And then when the button is pressed, set the other image which shows it pressed, then the image with a check using isSelected method of UIButton.

Hope this makes some sense to you.

answered 2011-11-25T10:47:02.000

Your Answer