Skip to content

Commit 2bd7916

Browse files
committed
Merge pull request ECSlidingViewController#27 from anagromataf/feature/keep-top-view-frame
Keep frame of the top view
2 parents 8e135af + de73355 commit 2bd7916

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ECSlidingViewController/Vendor/ECSlidingViewController/ECSlidingViewController.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ @implementation ECSlidingViewController
9393

9494
- (void)setTopViewController:(UIViewController *)theTopViewController
9595
{
96+
CGRect topViewFrame = _topViewController ? _topViewController.view.frame : self.view.bounds;
97+
9698
[self removeTopViewSnapshot];
9799
[_topViewController.view removeFromSuperview];
98100
[_topViewController willMoveToParentViewController:nil];
@@ -104,7 +106,7 @@ - (void)setTopViewController:(UIViewController *)theTopViewController
104106
[self.topViewController didMoveToParentViewController:self];
105107

106108
[_topViewController.view setAutoresizingMask:self.autoResizeToFillScreen];
107-
[_topViewController.view setFrame:self.view.bounds];
109+
[_topViewController.view setFrame:topViewFrame];
108110
_topViewController.view.layer.shadowOffset = CGSizeZero;
109111
_topViewController.view.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.view.layer.bounds].CGPath;
110112

0 commit comments

Comments
 (0)