简体   繁体   中英

Scroll table view cell by cell

I have a table and i want the rows to be displayes row by row , not all in the same time and after all visible rows are showed to scroll the table to see the rest .

I did this :

- (void)viewDidAppear:(BOOL)animated{

    [self.tableView setContentOffset:CGPointMake(0.0, self.tableView.contentSize.height - self.tableView.bounds.size.height)
                   animated:YES];

    [self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:29 inSection:0]
                     atScrollPosition:UITableViewScrollPositionBottom
                             animated:YES];

}

but my table is populated all in the same time , and the scroll is too fast to the last cell. Any ideea ?

Do you need these?

UIScrollViewDelegate:

- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate;
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView;

I guess you want to increase one row each time when user tries to scroll to see next row.

if you want to do this then you have to make a logic like this

1.) first you have to limit the no of rows to popup in table view by using a variable(so that initially no of rows would be equal to table view height).

2.) then you have to use table view delegate method which calls when the table is tried to scrolled by user to increase the variable count by one.

3.) reload the table view.

by that you can increase the row of table view accordingly

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM