开发者

subview take touch event on all window

i have a little problem on my view.

I hav开发者_如何学编程e a uiviewControler, load a xib. on this view i have a UIButton ( on touch it's work fine)

I add a subview create by code (on a different class ) this view respond to her touch event.

when i add this subview on my view, the event on this view are ok, but the UIButton on my first uiview not work.

I have make an error ?

EDIT :

i have make some tests. my uiview is not really load alone. in fact i load a new uiviewController, and add it's subview to my current uiviewController.

And my problem it's due to the transparence of my new uiviewController was intercep my touch event.


If the subview's area overlaps the button it will prevent it from working. If the subview is displayed modally it will prevent the button from working. Otherwise, the button should work fine.

Your problem is most likely somewhere else.


I have change my structure code, mow my view is only manage by his class ( herited from uiview ) and i have no uiViewController just for manage this. On the apple documentation they say the uiview controller is for manage multiple uiview on windows, and in my old code not respect this.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜