Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
1つのUIViewを別のUIView(同じタッチイベントロジックを使用)に置き換えた後、2番目のUIViewがタッチイベントを取得しない理由はありますか?
私はそれらを使用して置き換えています:
[currentView removeFromSuperview]; NewView * newView = [[NewView alloc] init]; [ウィンドウaddSubview:newView];
助けてくれてありがとう:)
NewViewそもそもあなたのクラスはタッチイベントを受け取るように設定されていますか? (Interface Builder で「User Interaction Enabled」チェックボックスを設定するか、にuserInteractionEnabled BOOL property設定しYESますUIView)?
NewView
userInteractionEnabled
BOOL
property
YES
UIView
UIViewビュー階層の下NewView(つまり の子)は、メソッドNewViewでタッチ イベントを消費していますか?touchesBegan:withEvent:
touchesBegan:withEvent: