2019-03-13

2019-03-13  本文已影响0人  elephant0001

-(void)scrollViewDidScroll:(UIScrollView*)scrollView

{

    if(scrollView ==scroll) {

        CGFloatx = scrollView.contentOffset.x;

        self.selectIndex= x /SCREEN_WIDTH;

        [self changeButtonTextColor];

        [self changeLinePlaceWithIndex:self.selectIndex];

        return;

    }

}

//改变line位置

- (void)changeLinePlaceWithIndex:(NSInteger)index

{

    [UIView animateWithDuration:0.5 animations:^{

        CGRectframe =self->line.frame;

        frame.origin.x=SCREEN_WIDTH/2* index +SCREEN_WIDTH/4-17*SCREENRATE;

        self->line.frame= frame;

    }];

}

上一篇 下一篇

猜你喜欢

热点阅读