Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIButton on left side of screen (in iOS 7 navigation slide area) not highlighted

I have a UIButton on the far left of a view controller (on a XIB), of say 100 points wide.

If the view controller is on a regular tab (i.e. not pushed on navigation stack) the button highlights as expected when tapped.

However, when the view controller is on a More-tab (so pushed on the navigation stack), the button is not highlighted when tapped on its left side (say the left most 50 points). The button does function, it's action is being called. But, when tapped on the right side it does highlight. (BTW, I think this is a general issue when the view controller is pushed from any other view controller; does probably not have to be More tab.)

After some research it turns out it's when I tap in the left screen area with which you can iOS-7-slide back to the parent view. Any ideas why this is, and how to make the button work properly again.

Thanks for your time!

like image 603
meaning-matters Avatar asked Feb 24 '14 19:02

meaning-matters


1 Answers

I can confirm this bug with almost no code at all. All you need is an image file to serve as the background image. In the storyboard set this up:

Navigation Controller -> (root view controller) ViewController -> Button -> push segue... ->
ViewController2 -> Button

Put the second button up against the left side of its containing view (ViewController2's view) and set the image file as its highlighted background image.

Now run the app and tap the first button, to summon the second view controller's view. Tap the button at its right side: the highlighted background image appears. Now tap the button at its left side: the highlight background image does not appear, but the button is in fact receiving the tap (you can confirm that by giving it an action method that logs).

So, I would say you've got yourself a legitimate bug and you should report it to Apple. I'm certainly going to!

like image 114
matt Avatar answered Oct 26 '22 18:10

matt