here's an odd one..
I've got a UIView
xib file that looks like this:
I've connected every UIButton
touchDown
and touchUpInside
events to two IBAction
methods:
- (IBAction)touchUpInside:(id)sender
{
NSLog(@"touch up inside");
if (((UIButton *)sender == _enter) | ((UIButton *)sender == _back)) {
[(UIButton *)sender setBackgroundColor:_color2];
}
else {
[(UIButton *)sender setBackgroundColor:_color1];
}
}
- (IBAction)touchDown:(id)sender
{
NSLog(@"touch down");
[(UIButton *)sender setBackgroundColor:_color2];
}
Everything works except for the bottom-most row of UIButton
's, that's the odd part:
The touch down
event is fired, but the button must be held for 0.5 second for it to change background color, whereas it is instantaneous for the other buttons.
It ONLY happens for the bottom-most row of UIButton
's, as I've tried to switch buttons 7, 8, 9 with buttons @back, 0, @enter like this:
I've checked in Interface Builder all the UIButton
attributes are the same, and I've tried moving the UIButton
's objects order around as you can see on the left side of the picture, and I'm about out of ideas already. Basically what's odd is the UIControl
behavior differs based on its position on the parent view...
UPDATE: I made the parent UIView
height value large enough that there is 50 free pixels below the last row and the UIButton
's work fine now. The only reason I can think of now is that there is a UITabBar
there 2 view controllers level underneath. Even so it doesn't make sense.