Reputation: 660
I need to create a scrolling grid of buttons. The easiest way I could think was to use a uitableview and draw the buttons on at run time, 3 buttons per cell. This works fine but the problem comes when trying to scroll the table. If the user tries to scroll the table but the touch begins on the button then the tableview does not receive the event and therefore does not scroll, I need the behaviour to be similar to that of the iphone springboard, ie user can page through even if touch begins on a button. Does anyone know how this is achieved... Touch forwarding or something else?
Many thanks
Jules
Upvotes: 0
Views: 1031
Reputation: 4080
You can forward events like this:
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
if ([touches count] == 1)
{
//Your code here than should return if it reacts to touch
}
//forwarding action:
[self.nextResponder touchesBegan:touches withEvent:event];
}
Upvotes: 1