Here is a question for you:
I’ve got a UIButton that we’ll call bottomButton. I have another UIButton that we’ll call topButton. What I want to do is place topButton on top of bottomButton such that when you tap topButton, it’s action is executed. The problem that I’m having is that when I tap topButton, its bottomButton‘s action that is getting executed.
So what I want to know is if it is possible to place a UIButton on another UIButton so that when tapped, only the top UIButton registers the tap. Savvy?
Any input is appreciated!
Yes, it’s possible. There are three things to check out:
1) Is topButton actually situated above bottomButton in the view stack?
[UIView bringSubviewToFront:]may help here.2) Is topButton large enough to register the tap?
Try making topButton larger than 44×44 and see if that helps.
3) Make sure that topButton is enabled.
EDIT
I just saw your comment about adding topButton as a subview of bottomButton, and that’s likely to be part of the problem. You could try adding both bottomButton and topButton to a new UIView, and then add that new UIView where you had previously used bottomButton.