Iam having a UItableview which is populated from array and a drop down list. If i select any row of drop down list the array will be inserted with new values and tableview should reload. How to animate the tableview with new array contents ? thanks in advance
animation like i want to show the row one by one . i tried this method
- (void)reloadRowsAtIndexPaths:(NSArray )indexPaths withRowAnimation:(UITableViewRowAnimation)animation {
NSIndexPath rowToReload = [NSIndexPath indexPathForRow:[names count] inSection:0];
NSArray* rowsToReload = [NSArray arrayWithObjects:rowToReload, nil];
[tableDetails reloadRowsAtIndexPaths:rowsToReload withRowAnimation:UITableViewRowAnimationNone];
}
I have tried this and my
Table
isAnimated
with smooth animation//Put this code where you want to reload your table view
Try Animating while Transition Change of a view while reloading UITableView
You first tell the tableView to expect updates with
beginUpdates
. Then update the relevant sections (if your tableView has only one section then just pass zero for the section number). Here's where you specify the animation - you can play around with it to get the effect that you want. After that you callendUpdates
on the tableView. The typedef for UITableViewRowAnimation specifies:Play around to see which one you want. Even selecting
UITableViewRowAnimationNone
can have a nice effect sometimes. Table update code below: