UITableView滑动高度及其解决不准问题

1、设置TanleView预加载section高度及其row高度,

_groupTableView.estimatedRowHeight =0; _groupTableView.estimatedSectionFooterHeight=0;_groupTableView.estimatedSectionHeaderHeight = 0;

2、检查TableView有没有在什么地方设置了contentInset属性,如果有会有一定的影响。可以设置为tableView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);即可。

3、下面滑动到指定section及其row的时候,切记动画要设置为NO,才能准确。

NSIndexPath * dayOne = [NSIndexPath indexPathForRow:0 inSection:0];
        [_groupTableView scrollToRowAtIndexPath:dayOne atScrollPosition:UITableViewScrollPositionTop animated:NO];

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容