0
시간이 지나면 UITableView에서 셀을 reoder하는 기능을 시도합니다.UITableView에서 셀을 재정렬하는 방법
나는 세포
-(UITableViewCell *)tableView:(UITableView *)tV cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tV dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
// Set up the cell...
cell.textLabel.text = [array objectAtIndex:indexPath.row];
cell.showsReorderControl = YES;
return cell;
}
을 만들고 난이있어 :
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
return YES;
}
버튼 방법
- (IBAction)delete:(id)sender {
if (self.btnLeft.tag == 0) {
self.btnLeft.title = @"Zakończ";
[self.tableView setEditing:YES animated:YES];
self.btnLeft.tag = 1;
}
else if (self.btnLeft.tag == 1) {
self.btnLeft.title = @"Edytuj";
[self.tableView setEditing:NO animated:YES];
self.btnLeft.tag = 0;
}
}
내가 편집 버튼 전을 setEditing to YES
을 클릭 만하면하지만 난 할 수 재정렬이 아니라 행만 삭제하십시오. 언제 오류가 있습니까? 내 말은 오른쪽 셀쪽에 재주문 아이콘이 없다는 뜻입니다.
나는 스스로 죽일거야 - 나는이 방법들을 가지고있다. cell.showsReorderControl = YES; 각 셀 클래스에 대해 ...하지만 재정렬 컨트롤러가 나타나지 않습니다 : / – raistlin