Browse Source

add shouldStretchDrawer property to drawerStyle (#1817)

Jong Eun Lee 7 years ago
parent
commit
9da36a04bb
2 changed files with 5 additions and 0 deletions
  1. 1
    0
      docs/top-level-api.md
  2. 4
    0
      ios/RCCDrawerController/RCCDrawerController.m

+ 1
- 0
docs/top-level-api.md View File

@@ -76,6 +76,7 @@ Navigation.startTabBasedApp({
76 76
       contentOverlayColor: 'rgba(0,0,0,0.25)', // optional, add this if you want a overlay color when drawer is open
77 77
       leftDrawerWidth: 50, // optional, add this if you want a define left drawer width (50=percent)
78 78
       rightDrawerWidth: 50 // optional, add this if you want a define right drawer width (50=percent)
79
+      shouldStretchDrawer: true // optional, iOS only with 'MMDrawer' type, whether or not the panning gesture will “hard-stop” at the maximum width for a given drawer side, default : true
79 80
     },
80 81
     type: 'MMDrawer', // optional, iOS only, types: 'TheSideBar', 'MMDrawer' default: 'MMDrawer'
81 82
     animationType: 'door', //optional, iOS only, for MMDrawer: 'door', 'parallax', 'slide', 'slide-and-scale'

+ 4
- 0
ios/RCCDrawerController/RCCDrawerController.m View File

@@ -100,6 +100,10 @@ UIViewController *rightViewController = nil;
100 100
         UIColor *color = contentOverlayColor != (id)[NSNull null] ? [RCTConvert UIColor:contentOverlayColor] : nil;
101 101
         [self setCenterOverlayColor:color];
102 102
     }
103
+    
104
+    if (self.drawerStyle[@"shouldStretchDrawer"]) {
105
+        self.shouldStretchDrawer = ([self.drawerStyle[@"shouldStretchDrawer"] boolValue]) ? YES : NO;
106
+    }
103 107
 }
104 108
 
105 109