gpt4 book ai didi

iOS 滑动 UITableView

转载 作者:行者123 更新时间:2023-11-30 13:54:29 26 4
gpt4 key购买 nike

我正在寻找类似的实现,如下所示:https://github.com/umano/AndroidSlidingUpPanel但对于iOS。目前我有一个带有 UITableView 的 ViewController 。我重写此方法,以便可以在点击时展开列表:

    func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
print("selected: \(indexPath.row)")
self.view.layoutIfNeeded()
UIView.animateWithDuration(1, animations: {
self.mTableViewTopConstant.constant = 200
self.view.layoutIfNeeded()
})
}

我现在想要的是:如果列表展开并且滚动位置位于顶部,当我在列表上向下移动手指(快速滑动)时,列表应该折叠。另外,如果可能的话,当我移动手指时,列表应该遵循我的方向。我深入研究了 UIScrollViewDelegate,但没有找到滚动列表时触发的方法。有吗?

最佳答案

您没有找到在 UIScrollViewDelegate 中滚动时触发的方法?!? :-)

https://developer.apple.com/library/prerelease/ios//documentation/UIKit/Reference/UIScrollViewDelegate_Protocol/index.html

  • scrollViewDidScroll:
  • scrollViewWillBeginDragging:
  • scrollViewWillEndDragging:withVelocity:targetContentOffset:
  • scrollViewDidEndDragging:willDecelerate:
  • scrollViewShouldScrollToTop:
  • scrollViewDidScrollToTop:

选择一个伴侣:-)

关于iOS 滑动 UITableView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33814258/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com