美文网首页
2019-03-13

2019-03-13

作者: elephant0001 | 来源:发表于2019-03-13 22:27 被阅读0次

-(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;

    }];

}

相关文章

网友评论

      本文标题:2019-03-13

      本文链接:https://www.haomeiwen.com/subject/vzbxmqtx.html