0
UITableView
을 끌기 위해 UIPanGestureRecognizer
을 사용하고 있습니다. 현재 UITableView
을 0
또는 그 너비의 절반까지 드래그 할 수 없도록 설정했습니다. 하지만 이제 프레임이 0으로 설정되었습니다. UITableView
을 0보다 큰 원점에서 다시 0으로 드래그하면 어떻게됩니까? 이것을 막고 UITableView
을 0으로 드래그 할 수 있습니까? 나는 다음을 시도했지만, 왜 그렇게 윤곽이 잡힌 코드가 이것을 일으키는 지 알 수 없다.UITableView 끌기
- (void) handlePan:(UIPanGestureRecognizer *) pan {
CGPoint point = [pan translationInView:_tableView];
CGRect frame = [_tableView frame];
if (point.x <= _tableView.frame.size.width/2) {
frame.origin.x = point.x;
}
NSLog(@"%f : %f", frame.origin.x, _tableView.frame.origin.x);
//outline begin!
if (frame.origin.x < 0 && _tableView.frame.origin.x >= 0) {
frame.origin.x = 0;
}
//outline end!
isFilterViewShowing = frame.origin.x > 0;
[_tableView setFrame:frame];
}
실제로 도움이되지 않았지만 superView를 사용해 보았지만 아무런 반응이 없었습니다. 내 코드가 작동하지 않는 이유를 이해할 수 있습니까? –
superView에서 touch를 찾지 않고 superView의 좌표계에서 변환 CGPoint를 반환하도록합니다. –
예를 들어 주시겠습니까? –