......
// Navigation will automatically add 64, we are here to deal with part of the logic
if scrollView.contentInset.top != insets.top || scrollView.contentOffset.x != -insets.top {
UIView .animateWithDuration(0.2, animations: {
scrollView.contentInset = insets
scrollView.contentOffset = CGPoint.init(x: scrollView.contentOffset.x, y: -insets.top)
})
}
......
}
在 ESRefreshHeaderView这个类中有个小小的问题,或者说,我没看明白吧,
...... // Navigation will automatically add 64, we are here to deal with part of the logic if scrollView.contentInset.top != insets.top || scrollView.contentOffset.x != -insets.top { UIView .animateWithDuration(0.2, animations: { scrollView.contentInset = insets scrollView.contentOffset = CGPoint.init(x: scrollView.contentOffset.x, y: -insets.top) }) } ...... }
您能解释一下,if判断的第二个条件是什么意思?是不是scrollView.contentOffset.y != -inset.top?