Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

fenrus110

macrumors regular
Original poster
Mar 24, 2008
142
0
I have a screen in landscape orientation with a UIToolbar at the bottom with 5 UIBarButtonItem's with flexible space between them. I wrote my IBAction and hooked them up. So it looks like this on the bottom:
X-X-X-X-X

They all work fine, but I can also trigger the action when I touch the flexible space to the left of the button. Is this a bug or something?

In Interface Bulder, the flexible space is of type UIBarButtonItem. In the connections page, there is nothing in the Sent Actions.
 

SqueegyX

macrumors regular
Mar 24, 2008
108
1
I think the toolbar is just thinking that you missed and is activating the nearest button.
 

lawicko

macrumors member
Jul 17, 2008
44
0
I had similar problem some time ago, but in my case the action called was the default action connected with the view actually presented just above my toolbar (above in sense of y axis). I think the problem was that the toolbar actually forwarded the touches to the first responder, and it is possible that the main view was underneath (in sense of z axis) my toolbar, that's why default action was called. Instead of using standard UIToolbar try to subclass it and implement all UIResponder methods in your subclass. Leave the methods empty and see what happens. Or at least swith userInteractionEnabled off for your toolbar and see if it helps, don't know if buttons will work in this set up though.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.