可以實現多種不同表頭效果:VGParallaxHeader
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);
} 
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!