override func scrollViewDidScroll(scrollView: UIScrollView) {
let yPosition = scrollView.contentOffset.y
if (yPosition > yourView.frame.size.height) {
return;
}
yourView.frame = CGRectMake(0, -yPosition, yourView.frame.size.width, yourView.frame.size.height)
tableView.frame = GRectMake(0, yourView.frame.origin.y + self.yourView.frame.size.height, tableView.frame.size.width, tableView.frame.size.height)
}
您可能需要调整框架定位逻辑,这是我脑海中想到的。
scrollView
委托方法并检测用户是否朝特定方向滚动。根据滚动距离手动隐藏view
。 - Blind Ninja