iPhone UITableViewCell如何滚动到视图顶端。

     如何让UITableViewCell滚动到视图顶端。

答案如下: 

 

- (void)scrollToRowAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UITableViewScrollPosition)scrollPosition animated:(BOOL)animated;
- (void)scrollToNearestSelectedRowAtScrollPosition:(UITableViewScrollPosition)scrollPosition animated:(BOOL)animated;
这两个方法都可以用,第一个函数是吧当前行滚动到指定位置,(UITableViewScrollPosition)scrollPosition-这个有四个选择:top,mid,bot,,,,,第二个函数是滚动到最近的位置

 

posted on 2012-02-15 12:00  wtq  阅读(9026)  评论(0编辑  收藏  举报