fixes #93 .. As far as I can tell

This commit is contained in:
Mazyad Alabduljaleel 2015-10-20 19:54:29 -07:00
parent ff67d2b0a0
commit baffc6fe0d
3 changed files with 20 additions and 3 deletions

View File

@ -72,7 +72,7 @@ static void * const kTLYShyNavBarManagerKVOContext = (void*)&kTLYShyNavBarManage
@implementation TLYShyStatusBarController
- (CGFloat)viewMaxY
- (CGFloat)_statusBarHeight
{
CGFloat statusBarHeight = AACStatusBarHeight(self.viewController);
/* The standard status bar is 20 pixels. The navigation bar extends 20 pixels up so it is overlapped by the status bar.
@ -87,6 +87,16 @@ static void * const kTLYShyNavBarManagerKVOContext = (void*)&kTLYShyNavBarManage
return statusBarHeight;
}
- (CGFloat)viewMaxY
{
return [self _statusBarHeight];
}
- (CGFloat)calculateTotalHeightRecursively
{
return [self _statusBarHeight];
}
@end
@ -417,7 +427,7 @@ static void * const kTLYShyNavBarManagerKVOContext = (void*)&kTLYShyNavBarManage
- (void)layoutViews
{
UIEdgeInsets scrollInsets = self.scrollView.contentInset;
scrollInsets.top = self.extensionController.viewMaxY;
scrollInsets.top = [self.extensionController calculateTotalHeightRecursively];
if (UIEdgeInsetsEqualToEdgeInsets(scrollInsets, self.previousScrollInsets))
{

View File

@ -29,6 +29,8 @@ typedef NS_ENUM(NSInteger, TLYShyNavViewControllerFade) {
@property (nonatomic, readonly) CGFloat viewMaxY;
- (CGFloat)calculateTotalHeightRecursively;
@end
/* CLASS DESCRIPTION:
@ -56,8 +58,8 @@ typedef NS_ENUM(NSInteger, TLYShyNavViewControllerFade) {
*/
@property (nonatomic) BOOL sticky;
- (CGFloat)updateYOffset:(CGFloat)deltaY;
- (void)offsetCenterBy:(CGPoint)deltaPoint;
- (CGFloat)updateYOffset:(CGFloat)deltaY;
- (CGFloat)snap:(BOOL)contract;

View File

@ -16,6 +16,11 @@
return CGRectGetMaxY(self.view.frame);
}
- (CGFloat)calculateTotalHeightRecursively
{
return CGRectGetHeight(self.view.bounds) + [self.parent calculateTotalHeightRecursively];
}
@end