我把一个选项卡view放在了sectionheader里面 也就实现了自带的悬停效果。 可是一滑倒处于悬停位置时候,下面黄色的指示条就回归到最初始位置。这个问题有人遇到过吗?
学习是最好的投资!
Because the section view is regenerated every time, you need to record the position information of all indicator bars in the viewcontroller. Just set the yellow indicator bar every time you return the section view
// Remove UItableview headerview stickiness (sticky)
- (void)scrollViewDidScroll:(UIScrollView *)scrollView { CGFloat sectionHeaderHeight = 40; if (scrollView.contentOffset.y<=sectionHeaderHeight&&scrollView.contentOffset.y>=0) { scrollView.contentInset = UIEdgeInsetsMake(-scrollView.contentOffset.y, 0, 0, 0); } else if (scrollView.contentOffset.y>=sectionHeaderHeight) { scrollView.contentInset = UIEdgeInsetsMake(-sectionHeaderHeight, 0, 0, 0); } }
Try this
See if the tableview is refreshed when sliding. If refreshed, the section header will be redrawn without reuse.
Brother, what is your solution to this problem?
Because the section view is regenerated every time, you need to record the position information of all indicator bars in the viewcontroller. Just set the yellow indicator bar every time you return the section view
// Remove UItableview headerview stickiness (sticky)
Try this
See if the tableview is refreshed when sliding. If refreshed, the section header will be redrawn without reuse.
Brother, what is your solution to this problem?