sách gpt4 ai đã đi

iOS 滑动 UITableView

In lại 作者:行者123 更新时间:2023-11-30 13:54:29 28 4
mua khóa gpt4 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,但没有找到滚动列表时触发的方法。有吗?

1 Câu trả lời

您没有找到在 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/

28 4 0
行者123
Hồ sơ cá nhân

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá Didi Taxi miễn phí
Mã giảm giá Didi Taxi
Giấy chứng nhận ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com