0
votes

I want a button tap effect for a UIBarButtonItem. My navigation bar has black tint color:

[self.navigationController.navigationBar setTintColor:[UIColor blackColor]];

So when I tap on any UIBarButtonItem on it, I do not get a button tapping effect. If I change the tint color to some other color like gray, it works. But I want only the black color there in the tint.

When you tap on a button, it color fades and you feel the tapping effect. That is because of touchUpInside action associated with UIButton class but nothing such event is there with UIBarButtonItem. I can get that effect with UIBarButtonItem if I set the Tint color of Navigaiton bar to other than black or dark gray.

Any suggestions.

2

2 Answers

0
votes

You can always set your UIBarButtonItem custom view to a UIButton, then youll have whatever effect from UIButton that you like...

0
votes

I got this done by setting the nav bae style:

myController.navigationBarStyle = UIBarStyleBlackOpaque;