swift 3 ios tableview 按单元滚动 [英] swift 3 ios tableview scroll by cell

查看:56
本文介绍了swift 3 ios tableview 按单元滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个 tableview,它按预期正常工作.但是,我想改变滚动方式,用户一次只能滚动一个单元格,这样,单元格永远不会被切成两半.

I created a tableview and it works normally as intended. However, I would like to change the scrolling such a way where the user can only scroll one cell at a time so that, there is never a time where the cell is cut in half..

这是一个例子:http://imgur.com/ffmk0jP

所以基本上我不希望默认滚动..我希望它一次滚动一个单元格以始终保持原始状态的视图..

So basically i do not want the default scrolling.. i would like it to be scrolled one cell at a time to constantly remain with the view of the original state..

有办法吗?

推荐答案

这个怎么样?

  1. scrollToNearestSelectedRowAtScrollPosition:animated:?

tableview scrollRectToVisible:CGRectMake(0, 0, 1, 1) 动画:NO];

这篇关于swift 3 ios tableview 按单元滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆