views:

28

answers:

1

I am using a UITableView in my app. After scrolling down, if I tap on the status bar time, the table is repositioned to the top. Any idea how this is done and is it possible to intercept the action. TIA, Jim B

+1  A: 

A UITableView is an extension of UIScrollView, and UITableViewDelegate is an extension of UIScrollViewDelegate.

A UIScrollViewDelegate can implement this method:

- (BOOL)scrollViewShouldScrollToTop:(UIScrollView *)scrollView

That will allow you to intercept it.

You can also just turn it off with your tableview's "scrollsToTop" property.

If you just want to know when it happens, you can use this delegate method:

- (void)scrollViewDidScrollToTop:(UIScrollView *)scrollView
DougW
Thank you. Too simple, I should have known this, but I was making it difficult. Many thanks again.
Jim B