开发者

Button not always getting the touch. Touch sometimes goes to another View Controller

I'm looking for some kind of solution to a problem I have.

I have a main view controller. On this view controller I have a button it works well most of the time. But when i pop up smaller view controller onto my main view controller, a part of the small view controller is behind the button.

So the button is is still on the front of the sceen, with the small view controller behind it.

The small view controller seems to take the key presses that were ment for the button. Is there a way to get the button to take the keypr开发者_开发问答esses? I though it having the higher z order would make this so, but obviously not. Is there a work around of this?

Or am I going to need to have an invisible button on my small view controller that calls back to the parent view controller to say the button was pressed.

Many Thanks C :)


Key presses go to the first responder of a window not the frontmost view in the z order. So after popping up the small view controller make the button first responder then key presses will go to it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜