scrollview
向下滚动时,我想禁用弹跳功能。
当我禁用垂直反弹时,我将无法refresh
打开桌子。任何建议如何禁用反弹,但启用刷新表?
我以这种方式刷新:
self.refreshControl = UIRefreshControl() self.refreshControl.addTarget(self, action: "refresh:", forControlEvents: UIControlEvents.ValueChanged) self.tableView.addSubview(refreshControl) func refresh(sender:AnyObject) { getJson() self.tableView.reloadData() self.refreshControl.endRefreshing() }
谢谢。
只是这样做:
func scrollViewDidScroll(scrollView: UIScrollView) { if scrollView.contentOffset.y < 0.0 { return } if (scrollView.contentOffset.y >= scrollView.contentSize.height - scrollView.frame.size.height) { scrollView.setContentOffset(CGPointMake(scrollView.contentOffset.x, scrollView.contentSize.height - scrollView.frame.size.height), animated: false) } }