ios开发之--令UITableView滚动到指定位置
发布日期:2021-08-21 13:17:47 浏览次数:30 分类:技术文章

本文共 518 字,大约阅读时间需要 1 分钟。

这个应用场景还是挺多的,代码如下:

//获取到需要跳转位置的行数NSIndexPath *scrollIndexPath = [NSIndexPath indexPathForRow:10 inSection:0];//滚动到其相应的位置[[self tableView] scrollToRowAtIndexPath:scrollIndexPath        atScrollPosition:UITableViewScrollPositionTop animated:YES];

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

typedef NS_ENUM(NSInteger, UITableViewScrollPosition) {    UITableViewScrollPositionNone,    UITableViewScrollPositionTop,        UITableViewScrollPositionMiddle,       UITableViewScrollPositionBottom};

 

转载于:https://www.cnblogs.com/hero11223/p/9237205.html

转载地址:https://blog.csdn.net/weixin_33720078/article/details/93666331 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:笔记2:傻瓜式盗QQ程序
下一篇:Chrome中使用showModalDialog无法接收返回值,解决方案

发表评论

最新留言

哈哈,博客排版真的漂亮呢~
[***.90.31.176]2024年04月04日 22时52分03秒