PDA

View Full Version : Press through UIView?




Danneman101
Oct 27, 2009, 02:44 PM
Im wondering if its possible to press right through a UIView?

I would like to have a button in the underlying view to recieve the press, but instead the view that is displayed on top is impeding this.

The view is placed on top of the underlying view using addSubview, so the underlying view is not pushed away or anything.

Possible?



dejo
Oct 27, 2009, 02:54 PM
Possible?
Certainly.

Hint: So what you're saying is that you don't want to enable user interaction for your UIView, is that right?

Danneman101
Oct 27, 2009, 04:55 PM
Great, that was the clue I needed - thanks a lot :)


UIView *myView = [[UIView alloc] initWithFrame:frame]; // main view
[view addSubview:myView2]; // subview
[myView2 setUserInteractionEnabled:NO]; // disable interaction with subview