0
我試圖禁用我遊戲的UIView的觸摸事件,但設置userInteractionEnabled = NO
似乎沒有任何效果。這是我在App中唯一的觀點。userInteractionEnabled不禁用觸摸事件
如果我檢查isUserInteractionEnabled
的視圖,它返回NO。
我通過我的UIViewController獲取我的-(void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event
消息,而不是UIView。由於添加了根UIViewController,我不再獲得發送到UIView的觸摸事件。
我在這裏做錯了什麼?我會假設設置userInteractionEnabled = NO
將停止所有觸摸事件的發生。
嘗試設置也viewController.view.userInteractionEnabled = NO; – 2012-03-16 17:53:49