UITableView
애니메이션 문제를 해결할 수있는 사람이 있습니까?UITableView add cell 애니메이션
기본적으로 UITableView
에는 셀 및 재정렬 셀을 삭제하는 애니메이션이 있습니다.
우리는 애니메이션 추가 셀을 사용할 수 있습니까?
가 나는 테이블 MyProfile의> 리트 윗에서 애니메이션을 확장 할 어떻게 twitter
하지 않았다 Three20을 체크 아웃했다.
Three20 frameowrk,
UITableView
의 기존 애니메이션을 사용하지 않고 사용해 보시기 바랍니다.
[self.dataSource addObject:@"New Item"];
NSIndexPath *newIndexPath = [NSIndexPath indexPathForRow:[self.dataSource count]-1 inSection:0];
[tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newIndexPath] withRowAnimation:UITableViewRowAnimationFade];
참고 : 데이터 소스 수에서 1 뺀 self.dataSource가 변경 가능한 배열되는 및 테이블 만 1 개 섹션을 갖는
- (void)insertRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation
예 :
코드를 보내 주셔서 감사합니다. 작동 샘플을 보내 주시겠습니까? o 삽입하는 동안 데이터 소스를 업데이트하는 방법과 약간 혼동 스럽습니다. – Ameya
이전에 나는 데이터 소스 (NSMutableArray)에 레코드를 추가하고 [self.tableView reloadData]를 호출하는 것입니다; 하지만 그건 새로운 요소를 생생하게 가져 오지 않을 것입니다. – Ameya
ur 코드의 작은 변화 @JK plz 답을 편집하여이 종류의 솔루션을 찾는 데 도움이되기를 바랍니다. [tableView insertRowsAtIndexPaths : [NSArray arrayWithObjects : [NSIndexPath indexPathForRow : [self.데이터 소스 개수] inSection : 0], nil] withRowAnimation : UITableViewRowAnimationRight]; – Ameya