UitableView에서 재정렬 컨트롤을 표시하면서 스 와이프로 지정된 기능을 활성화합니다
-
07-07-2019 - |
문제
나는 재주문을 허용하고자한다 UITableViewCell
s와 삭제하여 스 와이프를 통해 삭제하지만 삭제되지만 빨간색 삭제 원을 통한 것은 아닙니다.
- (void)loadView
{
[super loadView];
[table setEditing:YES animated:NO];
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Perform delete here
}
}
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
{
// Perform move here
}
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
return UITableViewCellEditingStyleDelete;
}
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
{
return YES;
}
또한 편집 모드를 비활성화하고 -[UITableViewCell setShowsReorderControl:YES]
운이 없습니다.
(원천: booleanmagic.com)
해결책
맞춤형 터치 이벤트 차단을해야한다고 생각합니다.
영어로 : 손가락이 움직이면 X 거리, 셀을 가로 지으며 해당 셀에서만 수평으로 만듭니다.
서클을 왼쪽으로 끄는 방법을 잘 모르겠지만 "Resorder Control 표시"와 같은 속성이라고 생각합니다.
제휴하지 않습니다 StackOverflow