Skip to content

Commit

Permalink
Add iOS8 title alpha support
Browse files Browse the repository at this point in the history
  • Loading branch information
ninjinkun committed Nov 6, 2014
1 parent 793cbe9 commit 3f243c4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion NJKScrollFullScreen/UIViewController+NJKFullScreenSupport.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ - (void)setNavigationBarOriginY:(CGFloat)y animated:(BOOL)animated
CGFloat bottomLimit = overwrapStatusBarHeight;

frame.origin.y = fmin(fmax(y, topLimit), bottomLimit);
CGFloat alpha = MAX(1 - (overwrapStatusBarHeight - frame.origin.y) / overwrapStatusBarHeight, kNearZero);

CGFloat navBarHiddenRatio = overwrapStatusBarHeight > 0 ? (overwrapStatusBarHeight - frame.origin.y) / overwrapStatusBarHeight : 0;
CGFloat alpha = MAX(1.f - navBarHiddenRatio, kNearZero);
[UIView animateWithDuration:animated ? 0.1 : 0 animations:^{
self.navigationController.navigationBar.frame = frame;
NSUInteger index = 0;
Expand Down

0 comments on commit 3f243c4

Please sign in to comment.