令UITableView滚动到指定位置

来源:互联网 发布:防空武器系统淘宝订购 编辑:程序博客网 时间:2024/04/28 05:21
//获取到需要跳转位置的行数NSIndexPath *scrollIndexPath = [NSIndexPath indexPathForRow:10 inSection:0];//滚动到其相应的位置[[self tableView] scrollToRowAtIndexPath:scrollIndexPath        atScrollPosition:UITableViewScrollPositionTop animated:YES];

//以下枚举决定滚动到指定位置的哪个位置

typedef NS_ENUM(NSInteger, UITableViewScrollPosition) {    UITableViewScrollPositionNone,    UITableViewScrollPositionTop,        UITableViewScrollPositionMiddle,       UITableViewScrollPositionBottom};                
原创粉丝点击