2011-09-20 2 views
0

pdf를 표시 할 상위 스크롤보기가 있습니다.보기가 있습니다. 그보기에는 확대/축소를위한 다른 스크롤보기가 있습니다. 스크롤 뷰 내부에는 오버레이 뷰가 있습니다. 오버레이보기를 만져야합니다. 나는 그것을 어떻게 얻을 수 있는가?scrolll보기 내부에있는보기에 대한 터치 받기

답변

0

오버레이보기에 UIGestureRecognizer을 추가하십시오. 보기에 속성이 YES으로 설정되어 있는지 확인해야합니다.

0
Make a new NSObject Class ScrollWithTouch and write following method inside .h and .m file: 
Code for .h file: 

@interface ScrollWithTouch : UIScrollView { 
} 
- (void) touchesEnded: (NSSet *) touches withEvent: (UIEvent *) event; 
-(id)initWithCustomScrollView; 
@end 

Code for .m file: 
#import "ScrollWithTouch.h" 


@implementation ScrollWithTouch 

-(id)initWithCustomScrollView{ 
    if (self = [super init]) { 

    } 
    return self; 
} 


- (void) touchesEnded: (NSSet *) touches withEvent: (UIEvent *) event 
{ 
    // If not dragging, send event to next responder 
    if (!self.dragging) 
     [self.nextResponder touchesEnded: touches withEvent:event]; 
    else 
     [super touchesEnded: touches withEvent: event]; 
} 
@end 

Now make a instance : 
ScrollWithTouch *tmpScrollView; 
tmpScrollView = [[ScrollWithTouch alloc] initWithCustomScrollView]; 

Add this new created object with your self.view; 
Now write touch related method within self.view. 
Assign tag for scroll view or assign tag for sub views on scroll view. 
Now you are ready to getting touch tag on tapping over scroll view. 
관련 문제