diff --git a/docs/styling-the-navigator.md b/docs/styling-the-navigator.md index dc9b9533a3f..f88d2a2fbf3 100644 --- a/docs/styling-the-navigator.md +++ b/docs/styling-the-navigator.md @@ -99,6 +99,9 @@ this.props.navigator.setStyle({ topBarShadowOpacity: 0.5, // Sets shadow opacity on the navbar, Works only when topBarElevationShadowEnabled: true topBarShadowOffset: 12, // Sets shadow offset on the navbar, Works only when topBarElevationShadowEnabled: true topBarShadowRadius: 3 // Sets shadow radius on the navbar, Works only when topBarElevationShadowEnabled: true + + preferredContentSize: { width: 500, height: 500 } // Sets the preferred size for the view controller’s view. + modalPresentationStyle: 'formSheet' // Sets the presentation style for modally presented view controllers. Supported styles are: 'formSheet', 'pageSheet', 'overFullScreen' and 'fullScreen'. // Android only navigationBarColor: '#000000', // change the background color of the bottom native navigation bar. diff --git a/ios/RCCViewController.m b/ios/RCCViewController.m index dee2dcc7f37..02d73485cb4 100755 --- a/ios/RCCViewController.m +++ b/ios/RCCViewController.m @@ -724,6 +724,15 @@ - (void)setStyleOnInit } else { self._statusBarHidden = NO; } + + NSDictionary *preferredContentSize = self.navigatorStyle[@"preferredContentSize"]; + if (preferredContentSize) { + NSNumber *width = preferredContentSize[@"width"]; + NSNumber *height = preferredContentSize[@"height"]; + if (width && height) { + self.preferredContentSize = CGSizeMake([width floatValue], [height floatValue]); + } + } } - (BOOL)hidesBottomBarWhenPushed