1

In my application I have table view cells with height of table view. When user scrolls it some times stops in between two cells, that is by showing half a cell,cell separator and half of other cell.

Is there any way by which I can scroll the table, after user rotation to a single cell?
Sample Screen shot

What we want is the table view should scroll to a single row automatically after user scroll.

Eldhose
  • 726
  • 8
  • 19
  • 1
    Take a look here http://stackoverflow.com/questions/7797693/force-uitableview-to-scroll-to-tops-of-cells – Abid Hussain Dec 04 '12 at 08:45
  • thanks Hussain,i know i can rotate using the method 'scrollToRowAtIndexPath:atScrollPosition:animated:' but i did know where to call it.Is there any method which is called after table scrolling? – Eldhose Dec 04 '12 at 09:00
  • Could you please explain it further more precisely. – Mohit Manhas Dec 04 '12 at 08:12

1 Answers1

0

Use scrollToRowAtIndexPath:atScrollPosition:animated: for scrolling to top cell. And as a UITableView is also UIScrollView so you can do it in UIScrollview's delegate method.

scrollViewDidEndDragging:willDecelerate:
Abid Hussain
  • 1,529
  • 1
  • 15
  • 33
  • thanks Abid, solved by implementing method - **'(void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset'** – Eldhose Dec 05 '12 at 05:39