exploring adding the extension view as a subview to the navbar..
This commit is contained in:
parent
7e10314d2f
commit
82879cff0c
|
|
@ -69,7 +69,7 @@ static inline CGFloat AACStatusBarHeight()
|
|||
self.extensionController.expandedCenter = ^(UIView *view)
|
||||
{
|
||||
return CGPointMake(CGRectGetMidX(view.bounds),
|
||||
CGRectGetMidY(view.bounds) + weakSelf.viewController.topLayoutGuide.length);
|
||||
CGRectGetMidY(view.bounds) + CGRectGetHeight(weakSelf.navBarController.view.bounds));
|
||||
};
|
||||
}
|
||||
return self;
|
||||
|
|
@ -93,10 +93,12 @@ static inline CGFloat AACStatusBarHeight()
|
|||
{
|
||||
_viewController = viewController;
|
||||
|
||||
[self.extensionViewsContainer removeFromSuperview];
|
||||
[self.viewController.view addSubview:self.extensionViewsContainer];
|
||||
UIView *navbar = viewController.navigationController.navigationBar;
|
||||
|
||||
self.navBarController.view = viewController.navigationController.navigationBar;
|
||||
[self.extensionViewsContainer removeFromSuperview];
|
||||
[navbar insertSubview:self.extensionViewsContainer atIndex:0];
|
||||
|
||||
self.navBarController.view = navbar;
|
||||
|
||||
[self _layoutViews];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,16 +37,13 @@ const CGFloat contractionVelocity = 140.f;
|
|||
return CGPointMake(self.expandedCenterValue.x, self.expandedCenterValue.y - self.contractionAmountValue);
|
||||
}
|
||||
|
||||
// This method is courtesy of GTScrollNavigationBar
|
||||
// https://github.com/luugiathuy/GTScrollNavigationBar
|
||||
- (void)_updateSubviewsToAlpha:(CGFloat)alpha
|
||||
{
|
||||
for (UIView* view in self.view.subviews)
|
||||
{
|
||||
bool isBackgroundView = view == self.view.subviews[0];
|
||||
bool isViewHidden = view.hidden || view.alpha < FLT_EPSILON;
|
||||
|
||||
if (!isBackgroundView && !isViewHidden)
|
||||
NSString *className = NSStringFromClass([view class]);
|
||||
if (![className isEqualToString:@"_UINavigationBarBackground"] &&
|
||||
![className isEqualToString:@"_UINavigationBarBackIndicatorView"])
|
||||
{
|
||||
view.alpha = alpha;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue