ios - tableview的sectionheader的悬停问题
PHPz
PHPz 2017-04-18 09:13:58
0
4
584

我把一个选项卡view放在了sectionheader里面 也就实现了自带的悬停效果。 可是一滑倒处于悬停位置时候,下面黄色的指示条就回归到最初始位置。这个问题有人遇到过吗?

PHPz
PHPz

学习是最好的投资!

reply all(4)
刘奇

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

PHPzhong

See if the tableview is refreshed when sliding. If refreshed, the section header will be redrawn without reuse.

PHPzhong

Brother, what is your solution to this problem?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template