Fixes to extension view
[FIX]: flexible width extension view by default [NEW]: add cleanup method again
This commit is contained in:
parent
3f82e33642
commit
a69bb8bdc3
|
|
@ -52,6 +52,8 @@
|
|||
- (void)layoutViews;
|
||||
/* Needs to be called in two places.. Please refer to the demo */
|
||||
- (void)scrollViewDidEndScrolling;
|
||||
/* Needs to be called on viewWillDisappear */
|
||||
- (void)cleanup;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ static inline CGFloat AACStatusBarHeight()
|
|||
|
||||
self.extensionViewContainer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100.f, 0.f)];
|
||||
self.extensionViewContainer.backgroundColor = [UIColor clearColor];
|
||||
self.extensionViewContainer.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleBottomMargin;
|
||||
|
||||
self.extensionController = [[TLYShyViewController alloc] init];
|
||||
self.extensionController.view = self.extensionViewContainer;
|
||||
|
|
@ -193,9 +194,15 @@ static inline CGFloat AACStatusBarHeight()
|
|||
|
||||
- (void)setExtensionView:(UIView *)view
|
||||
{
|
||||
// TODO: expand the container instead of just adding it on top
|
||||
self.extensionViewContainer.frame = view.bounds;
|
||||
[self.extensionViewContainer addSubview:view];
|
||||
if (view != [self.extensionViewContainer.subviews firstObject])
|
||||
{
|
||||
[[self.extensionViewContainer.subviews firstObject] removeFromSuperview];
|
||||
// TODO: expand the container instead of just adding it on top
|
||||
self.extensionViewContainer.frame = view.bounds;
|
||||
[self.extensionViewContainer addSubview:view];
|
||||
|
||||
[self layoutViews];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)prepareForDisplay
|
||||
|
|
@ -214,6 +221,11 @@ static inline CGFloat AACStatusBarHeight()
|
|||
self.scrollView.scrollIndicatorInsets = scrollInsets;
|
||||
}
|
||||
|
||||
- (void)cleanup
|
||||
{
|
||||
[self.navBarController expand];
|
||||
}
|
||||
|
||||
- (void)scrollViewDidEndScrolling
|
||||
{
|
||||
[self _handleScrollingEnded];
|
||||
|
|
|
|||
Loading…
Reference in New Issue