2011-09-05 2 views
0

많은보기가있는 앱을 개발하지만 팬 제스처를 사용하여 특정보기 (backgndView)를 이동하려는 경우 다른보기가 이동되었습니다. 내 원하는보기가 활성화되어 있지 않은 것 같습니다. 여기 코드.mutiple UIImageView에서 팬 제스처를 사용하는 방법

//---pan gesture--- 
UIPanGestureRecognizer *panGesture = 
[[UIPanGestureRecognizer alloc] 
initWithTarget:self 
action:@selector(handlePanGesture:)]; 

[backgndView addGestureRecognizer:panGesture]; 
[frameView addGestureRecognizer:panGesture]; 
[effectView addGestureRecognizer:panGesture]; 
[itemView addGestureRecognizer:panGesture]; 
[extraView addGestureRecognizer:panGesture]; 
[panGesture release]; 

제스처에는 extraView가 활성화되어 있지만 다른보기에는 활성화되어 있지 않습니다. 선택한보기를 활성화하는 다른 방법은 없습니까?

감사합니다.

답변

0

잘 알지 못했지만 날아가는듯한 느낌으로 팬 제스처를 위해 모든보기가 활성화되었습니다.

// --- 팬 제스처 ---

UIPanGestureRecognizer *panGesture = 
[[UIPanGestureRecognizer alloc] 
initWithTarget:self 
action:@selector(handlePanGesture:)]; 

[backgndView addGestureRecognizer:panGesture]; 
[panGesture release]; 

panGesture = 
[[UIPanGestureRecognizer alloc] 
initWithTarget:self 
action:@selector(handlePanGesture:)]; 
[frameView addGestureRecognizer:panGesture]; 
[panGesture release]; 

panGesture = 
[[UIPanGestureRecognizer alloc] 
initWithTarget:self 
action:@selector(handlePanGesture:)]; 
[effectView addGestureRecognizer:panGesture]; 
[panGesture release]; 

panGesture = 
[[UIPanGestureRecognizer alloc] 
initWithTarget:self 
action:@selector(handlePanGesture:)]; 
[itemView addGestureRecognizer:panGesture]; 
[panGesture release]; 

panGesture = 
[[UIPanGestureRecognizer alloc] 
initWithTarget:self 
action:@selector(handlePanGesture:)]; 
[extraView addGestureRecognizer:panGesture]; 

[panGesture release];