I am developing an Iphone application ,this contain a UITableview with 8 cells.I am implement an NSMutableArray for store each cells when the cell creation time ,but the tableview load time only provide the displayed cell store to the array.For avoid this issue i have autoscroll the table view and get the total cell for store to the array with the following code;
-(void)viewDidAppear:(BOOL)animated{
[tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:[musicGenre count]-1 inSection:0] atScrollPosition:UITableViewScrollPositionBottom animated:YES];
}
This is working perfectly.But now i want scroll this from bottom to top at the same time(load time) .How to implement this ?
Thanks in Advance.
Since
UITableViewinherits fromUIScrollViewyou could use something like this:EDIT:
If you want the initial move from top to bottm also animated simply use:
But please consider user experience – is that ammount of animation needed? Because users (especially if they will often use your app) dont like to loose time. Animation is great when it enhances user experience and doesn’t cause a delay in workflow.
EDIT2: for scrolling to top (from current position) you can use: