2009-09-17 3 views
12

UITableViewCell의 순서를 변경하고 스 와이프를 통해 삭제하여 빨간색 삭제 서클을 통해 삭제하지 않으려합니다.UITableView에서 순서 변경 컨트롤을 표시하면서 스 와이프를 사용하도록 설정

- (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]를 호출 시도했습니다.

Image http://booleanmagic.com/uploads/ReorderNotDelete.png

+0

가 그래, 난 알고 있어요 "쇼 제어 순서"와 같은 속성의 생각하는 방법을 확실하지. '링크 계정'기능이 작동하지 않았습니다. 최소한 저항의 길은 단지 새로운 계정을 만들고 임시 계정을 고아로 만드는 것이 었습니다. – rpetrich

답변

2

나는 당신이 어떤 사용자 정의 터치 이벤트 가로 채기를해야 할 것 같아요.

영어로 : 손가락이 움직 였다면, x 거리, 셀을 가로 질러, 그 셀에서만, 그리고 나서 삭제 제어를 보여줍니다.

왼쪽으로 원을 해제하는,하지만 난 그게

+0

불행히도 삭제 확인을 프로그래밍 방식으로 표시하는 방법이 없습니다 (showingDeleteConfirmation은 읽기 전용 임). 지금은 재주문 컨트롤을 볼 수있게 남겨두고 있지만, 아마도 터치를 가로 채고 사용자 정의 삭제 버튼을 수동으로 보여주는 것으로 끝날 것입니다. – rpetrich

관련 문제