Skip to content

Commit

Permalink
Fix #12
Browse files Browse the repository at this point in the history
Allows to update navigation bar's color (programmatically or from the
Storyboard)
  • Loading branch information
StefanLage committed Mar 9, 2015
1 parent b40b670 commit ce5c708
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions SLPagingView/SLPagingViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,13 @@ typedef void(^SLPagingViewDidChanged)(NSInteger currentPage);
*/
-(void)addViewControllers:(UIViewController *) controller needToRefresh:(BOOL) refresh;

/**
* Allows to update the navigationBar's background color
*
* @param color
*/
-(void)setNavigationBarColor:(UIColor*) color;

@end

extern NSString* const SLPagingViewPrefixIdentifier; // this is @"sl_"
Expand Down
7 changes: 7 additions & 0 deletions SLPagingView/SLPagingViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@ -(void)addViewControllers:(UIViewController *) controller needToRefresh:(BOOL) r
[self setupPagingProcess];
}

-(void)setNavigationBarColor:(UIColor*) color{
if(color)
self.navigationBarView.backgroundColor = color;
}

#pragma mark - Internal methods

-(void) initCrucialObjects:(UIColor *)background showPageControl:(BOOL) showPageControl{
Expand Down Expand Up @@ -312,6 +317,8 @@ - (void)loadStoryboardControllers
isThereNextIdentifier = NO;
}
}
if(self.navigationController && self.navigationController.navigationBar)
_navigationBarView.backgroundColor = self.navigationController.navigationBar.backgroundColor;
}
}

Expand Down

0 comments on commit ce5c708

Please sign in to comment.