Skip to content

Commit

Permalink
Fix SafeAreaView and width in sidedrawer (#3418, #4527) (#6080)
Browse files Browse the repository at this point in the history
Prevously: Adding a sideMenu with no width resulted in the side content having 100% width (partially drawn behind center view). Adding a sidemenu with a width option resulted in SafeAreaView inside the side content not working (content obstructed by iPhone notch).

Undoing the fix in commit 37f5697 fixes the first problem.
Calling setNeedsLayout on the sideMenu also fixes the original problem of SafeAreaView not working correctly. Although I am not sure why this is needed. There may a better solution.

Co-authored-by: Yogev Ben David <yogev132@gmail.com>
  • Loading branch information
adatadien and yogevbd authored Apr 2, 2020
1 parent 21cafcd commit 0da097e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/ios/RNNSideMenu/MMDrawerController/MMDrawerController.m
Original file line number Diff line number Diff line change
Expand Up @@ -940,6 +940,7 @@ - (void)setDrawerViewController:(UIViewController *)viewController forSide:(MMDr
}
[viewController didMoveToParentViewController:self];
[viewController.view setAutoresizingMask:autoResizingMask];
[viewController.view setFrame:viewController.mm_visibleDrawerFrame];
}
}

Expand Down Expand Up @@ -1402,6 +1403,7 @@ -(void)prepareToPresentDrawer:(MMDrawerSide)drawer animated:(BOOL)animated{
[sideDrawerViewControllerToPresent.view setHidden:NO];
[self resetDrawerVisualStateForDrawerSide:drawer];
[sideDrawerViewControllerToPresent.view setFrame:sideDrawerViewControllerToPresent.mm_visibleDrawerFrame];
[sideDrawerViewControllerToPresent.view setNeedsLayout]; // Added to make SafeAreaView in sideDrawerView work (#3418)
[self updateDrawerVisualStateForDrawerSide:drawer percentVisible:0.0];
[sideDrawerViewControllerToPresent beginAppearanceTransition:YES animated:animated];
}
Expand Down

0 comments on commit 0da097e

Please sign in to comment.