2016-07-18 6 views
4

현재 여러 페이지가 들어있는 가로 스크롤이 있습니다. 이러한 페이지 중 일부에는 스 와이프 한 셀이있는 표가 있습니다.셀과 가로 스크롤 사이의 스 와이프 충돌

아이디어는 셀을 스 와이프 할 수 있고이 스 와이프가 끝나면 스크롤 스 와이프를 활성화하여 다음 페이지로 이동할 수 있습니다. 이런 식으로 뭔가 :

enter image description here

하지만하려고 할 때, 그것은 충돌 발생하고 활성화를 동시에 2 스크롤. 즉, 셀이 이동하면서 버튼을 표시하는 동안 스크롤이 다른 페이지로 이동하기 시작합니다.

도 활성화되지
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    if (editingStyle == UITableViewCellEditingStyleDelete) { 
    } 
} 

, 그들은 완전히 셀의 강타를 무시하고 단지 스크롤이 활성화 슬쩍 : 다음과 같은 기본 기능이 있기 때문에 내가 SWTableViewCell 사용하고 슬쩍 전지

.

감사합니다. 도움을 주시면 감사하겠습니다.

+0

gif가 작동하지 않습니다. 나는 다른 UI를 디자인하는 것이 더 좋을 것이라고 생각한다. 당신은 스 와이프를 알고 스 와이프를 계속해서 메일 앱 결과에서 삭제 권리를 알고 있습니까? – Wain

+0

죄송합니다. @Wain이 (가) 선물을 다시 추가했습니다. – jose920405

+0

페이지 뷰 컨트롤러를 테이블 뷰와 함께 사용하지 않는 이유는 무엇입니까? – Rikh

답변

2

, 당신의 수평 스크롤 뷰를 들어이

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer 
{ 
    return TRUE; 
} 
0

시도
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { 
    if ([[otherGestureRecognizer.view class] isSubclassOfClass:[UITableView class]]) { 
     if ([otherGestureRecognizer isKindOfClass: [UIPanGestureRecognizer class]]) { 
      UIPanGestureRecognizer *otherPan = (UIPanGestureRecognizer *)otherGestureRecognizer; 
      CGPoint translation = [otherPan translationInView:otherGestureRecognizer.view]; 
      return translation.x < 0; 
     } 
    } 
    return NO; 
} 
관련 문제