I have a simple black navigation bar with following button

When the button is pressed the button gets the same color as the the navigation bar with the same gradient. But I want it to look like this:

So this has a simple black background color. Any idea how to achieve this with interface builder? Or does this require a programmatic way?
This is easy, first you need to do this. Goto your interface builder. Follow these steps –
UIButtonelement. Open the right-hand sidebar which gives attributes about the button. SelectTypeof your button asCustom.state config. The various states for a button – default, highlighted, selected, disabled. Define various different images as you want inimage. Basically select images such that the effect you want is satisfied.[yourButton setSelected:BOOL]or[yourButton setHighlighted:BOOL]or[yourButton setEnabled:BOOL]Hope this helps…
Update: See the screenshot – This shot shows that there are states defined, ‘default’, ‘highlighted’… this defines the states. You can define images for each of these states. Again, hope this helps…