Modal组件可以用来覆盖包含React Native根视图的原生视图(如UIViewController,Activity)。

在嵌入React Native的混合应用中可以使用Modal。Modal可以使你应用中RN编写的那部分内容覆盖在原生视图上显示。

属性

animatedbool

已过期

请使用animationType属性代替。

animationTypePropTypes.oneOf(['none', 'slide', 'fade'])

TheanimationTypeprop controls how the modal animates.

  • slide slides in from the bottom
  • fade fades into view
  • none appears without an animation

onRequestClosePlatform.OS === 'android' ? PropTypes.func.isRequired : PropTypes.func

TheonRequestCloseprop allows passing a function that will be called once the modal has been dismissed.

On the Android platform, this is a required function.

onShowfunction

TheonShowprop allows passing a function that will be called once the modal has been shown.

transparentbool

Thetransparentprop determines whether your modal will fill the entire view. Setting this totruewill render the modal over a transparent background.

visiblebool

Thevisibleprop determines whether your modal is visible.

iosonOrientationChangePropTypes.func

TheonOrientationChangecallback is called when the orientation changes while the modal is being displayed. The orientation provided is only 'portrait' or 'landscape'. This callback is also called on initial render, regardless of the current orientation.

iossupportedOrientationsPropTypes.arrayOf(PropTypes.oneOf(['portrait', 'portrait-upside-down', 'landscape', 'landscape-left', 'landscape-right']))

ThesupportedOrientationsprop allows the modal to be rotated to any of the specified orientations. On iOS, the modal is still restricted by what's specified in your app's Info.plist's UISupportedInterfaceOrientations field.

results matching ""

    No results matching ""