暂时更新些内容到这里,随后可能要整理博客内容到新的地址
取消tableView的sectionHeader置顶效果
- (void)scrollViewDidScroll:(UIScrollView *)scrollView { CGFloat sectionHeaderHeight = 44; 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); } }
还有关于layer图层的运用
- (void)addGradualChangeLayer { CAGradientLayer *gradientLayer = [CAGradientLayer layer]; gradientLayer.frame = self.label.frame; gradientLayer.colors = @[(id)[UIColor redColor].CGColor, (id)[UIColor blackColor].CGColor, (id)[UIColor blueColor].CGColor]; [self.layer addSublayer:gradientLayer]; gradientLayer.mask = self.label.layer; self.gradientLayer = gradientLayer; self.label.frame = gradientLayer.bounds; CADisplayLink *link = [CADisplayLink displayLinkWithTarget:self selector:@selector(colorChange)]; [link addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode]; } - (void)colorChange { self.gradientLayer.colors = @[(id)[UIColor whiteColor].CGColor, (id)[UIColor redColor].CGColor, (id)[UIColor grayColor].CGColor]; }