swift 3 ios tableview 按单元滚动

编程入门 行业动态 更新时间:2024-10-28 17:14:58
本文介绍了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..

这是一个例子:imgur/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..

有办法吗?

推荐答案

这个怎么样?

  • scrollToNearestSelectedRowAtScrollPosition:animated:?

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

  • 更多推荐

    swift 3 ios tableview 按单元滚动

    本文发布于:2023-11-26 20:24:24,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1635067.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:单元   swift   ios   tableview

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!