UITableView回滾到頂部的幾種方法

//***************方法一***************//

    //回滾到表的最頂端

    [self.tableView  scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:NO];



    //***************方法二***************//

    [self.tableView setContentOffset:CGPointMake(0,0) animated:NO];


    //***************方法三***************//

    NSIndexPath* indexPat = [NSIndexPath indexPathForRow:0 inSection:0];

   [self.tableView scrollToRowAtIndexPath:indexPat atScrollPosition:UITableViewScrollPositionBottom animated:YES];


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章