Skip to content

CreatureSurvive/CSInteractiveHeaders

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSInteractiveHeaders

A dead simple implementation of interactive (stretchable) header images that can easily be added to any UIScrollView, UITableView, UICollectionView, etc. This includes a navigation category to interactivly control the navigation bar transparency with the scroll view.

demo

Implementation

Implementing Interactive Headers

Import the category:

#import "UIScrollView+InteractiveHeader.h"

In your ViewController:

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.extendedLayoutIncludesOpaqueBars = YES;
    [self.tableView addHeaderWithImage:[UIImage imageNamed:@"banner.jpg"] height:300];
    [self.tableView.interactiveHeader setUseAlphaFade:YES];
    [self.tableView.interactiveHeader setLabelOffset:22];
    [self.tableView.interactiveHeader.titleLabel setText:@"A Clever Title"];
    [self.tableView.interactiveHeader.subtitleLabel setText:@"Some Sub-text"];
}

Implementing Interactive Navigation Bars

Import the category:

#import "UINavigationBar+InteractiveHeader.h"

In your ViewController:

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    
    [self.navigationController.navigationBar setScrollView:self.tableView];
    [self.navigationController.navigationBar setScrollTintColor:UIColor.darkTextColor];
}

thats it, your done.

Author

Dana Buehre (CreatureSurvive) cs@creaturecoding.com

© Dana Buehre (CreatureSurvive) 2020

About

Simple interactive header views for any scroll view

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published