Reputation: 10779
I have a UIButton that is not receiving touch events. I think their might be a transparent view in the way. How can I detect what is being touched?
I think their is an app that allows me to turn my UI sideways while in the simulator, but i cannot remember the name of it. I would be willing to buy it.
Or is there a way to do this code?
Upvotes: 0
Views: 147
Reputation: 852
Double check that Allow User Interaction is checked.
You could also delete the button, drag it back onto your view and hook up the methods.
Also make sure you are connected to the Touch Up Inside event and your method is an IBOutlet
- (IBAction) buttonPressed:(id)sender;
Upvotes: 1
Reputation: 3354
Have a look on DCIntrospect . It might solve your problem in. It's free to use and open source.
Upvotes: 0
Reputation: 8983
Allow user interaction like this:
yourButton.userInteractionEnabled = YES;
And if you add your button is on top of a UIImageView
, then add this: yourImageView.userInteractionEnabled = YES;
Hope this will help you out.
Upvotes: 0
Reputation: 10779
The issue is that I did not set the width and height for autolayout so even though I saw the view, its height and width were 0,0.
Upvotes: 0