Limit UITableView scroll speed like Instagram does it

后端 未结 2 534
轮回少年
轮回少年 2021-02-05 09:51

I\'m trying to limit the scroll speed of my UITableView, exactly like Instagram does it.

If you check out Instagram, you\'ll notice that they have a limit on how fast yo

2条回答
  •  自闭症患者
    2021-02-05 10:33

    Use this:

    self.tableview.scrollView.decelerationRate = UIScrollViewDecelerationRateFast;
    

    As tableView is a subclass of UIScrollView, ScrollView delegate will work here. Hope this helps.. :)

    Edit:

    if tableView doesn't show scrollView property use:

    self.tableView.decelerationRate
    

提交回复
热议问题