Bläddra i källkod

Fix SafeAreaView and width in sidedrawer (#3418, #4527) (#6080)

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>
rfnd 4 år sedan
förälder
incheckning
0da097ef84
No account linked to committer's email address
1 ändrade filer med 2 tillägg och 0 borttagningar
  1. 2
    0
      lib/ios/RNNSideMenu/MMDrawerController/MMDrawerController.m

+ 2
- 0
lib/ios/RNNSideMenu/MMDrawerController/MMDrawerController.m Visa fil

940
         }
940
         }
941
         [viewController didMoveToParentViewController:self];
941
         [viewController didMoveToParentViewController:self];
942
         [viewController.view setAutoresizingMask:autoResizingMask];
942
         [viewController.view setAutoresizingMask:autoResizingMask];
943
+        [viewController.view setFrame:viewController.mm_visibleDrawerFrame];
943
     }
944
     }
944
 }
945
 }
945
 
946
 
1402
     [sideDrawerViewControllerToPresent.view setHidden:NO];
1403
     [sideDrawerViewControllerToPresent.view setHidden:NO];
1403
     [self resetDrawerVisualStateForDrawerSide:drawer];
1404
     [self resetDrawerVisualStateForDrawerSide:drawer];
1404
     [sideDrawerViewControllerToPresent.view setFrame:sideDrawerViewControllerToPresent.mm_visibleDrawerFrame];
1405
     [sideDrawerViewControllerToPresent.view setFrame:sideDrawerViewControllerToPresent.mm_visibleDrawerFrame];
1406
+    [sideDrawerViewControllerToPresent.view setNeedsLayout]; // Added to make SafeAreaView in sideDrawerView work (#3418)
1405
     [self updateDrawerVisualStateForDrawerSide:drawer percentVisible:0.0];
1407
     [self updateDrawerVisualStateForDrawerSide:drawer percentVisible:0.0];
1406
     [sideDrawerViewControllerToPresent beginAppearanceTransition:YES animated:animated];
1408
     [sideDrawerViewControllerToPresent beginAppearanceTransition:YES animated:animated];
1407
 }
1409
 }