How can I click a button behind a transparent UIView?

Posted by Sean Clark Hess on Stack Overflow See other posts from Stack Overflow or by Sean Clark Hess
Published on 2010-06-15T15:51:41Z Indexed on 2010/06/15 15:52 UTC
Read the original article Hit count: 363

Filed under:
|
|
|

Let's say we have a view controller with one sub view. the subview takes up the center of the screen with 100 px margins on all sides. We then add a bunch of little stuff to click on inside that subview. We are only using the subview to take advantage of the new frame ( x=0, y=0 inside the subview is actually 100,100 in the parent view).

Then, imagine that we have something behind the subview, like a menu. I want the user to be able to select any of the "little stuff" in the subview, but if there is nothing there, I want touches to pass through it (since the background is clear anyway) to the buttons behind it.

How can I do this? It looks like touchesBegan goes through, but buttons don't work.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c