可以实现多种不同表头效果:VGParallaxHeader
jopen
10年前
VGParallaxHeader可以实现多种不同表头效果。包括拉长、放大图片、变换颜色等。
Import UIScrollView+VGParallaxHeader.h, and use as follows:
- (void)viewDidLoad { [super viewDidLoad]; HeaderView *headerView = [HeaderView alloc] init]; // or self.tableView [self.scrollView setParallaxHeaderView:headerView mode:VGParallaxHeaderModeFill // For more modes have a look in UIScrollView+VGParallaxHeader.h height:200 shadowBehaviour:VGParallaxHeaderShadowBehaviourDisappearing]; // For more behaviours have a look in UIScrollView+VGParallaxHeader.h } #pragma mark - UIScrollView Delegate - (void)scrollViewDidScroll:(UIScrollView *)scrollView { // This must be called in order to work [self.scrollView shouldPositionParallaxHeader]; // scrollView.parallaxHeader.progress - is progress of current scroll NSLog(@"Progress: %f", scrollView.parallaxHeader.progress); }