0

How can I get a button tap for a button which is located in a UIScrollView, but in its initially non-visible area?

Solved
Problem was that the content was visible within a non-clipped view - therefore not getting touches.

LK.
  • 4,499
  • 8
  • 38
  • 48

1 Answers1

0

I think you should add an action (yourAction in the code below) to the UIButton.

programmatically:

[button addTarget:self action:@selector(yourAction:) forControlEvents:UIControlEventTouchUpInside];


-(void)yourAction:(id)sender{
    // your code
}

With the gui builder you should connect your UIButton to an action defined as IBAction in your .h controller file:

-(IBAction)yourAction:(id)sender;
Matteo Alessani
  • 10,264
  • 4
  • 40
  • 57