这个应用场景还是挺多的,代码如下:
//获取到需要跳转位置的行数NSIndexPath *scrollIndexPath = [NSIndexPath indexPathForRow:10 inSection:0];//滚动到其相应的位置[[self tableView] scrollToRowAtIndexPath:scrollIndexPathatScrollPosition:UITableViewScrollPositionTop animated:YES];
以下枚举决定滚动到指定位置的哪个位置
typedef NS_ENUM(NSInteger, UITableViewScrollPosition) {UITableViewScrollPositionNone,UITableViewScrollPositionTop, UITableViewScrollPositionMiddle, UITableViewScrollPositionBottom};
如果觉得《ios开发之--令UITableView滚动到指定位置》对你有帮助,请点赞、收藏,并留下你的观点哦!