天天看點

react-native modal

1.屬性

animationType(動畫類型) PropTypes.oneOf([‘none’, ‘slide’, ‘fade’])

  none:沒有動畫

  slide:從底部滑入

  fade:淡入視野

onRequestClose(被銷毀時會調用此函數)Platform.OS ===’android’?PropTypes.func.isRequired:PropTypes.func

  在 ‘Android’ 平台,必需使用此函數

onShow(模态顯示的時候被調用)function

transparent (透明度) bool

  true時,使用透明背景渲染模态。

visible(可見性) bool

  決定模态是否可見

onOrientationChange(方向改變時調用)PropTypes.func

  在模态方向變化時調用,提供的方向隻是 ” 或 ”。在初始化渲染的時候也會調用,但是不考慮目前方向。

supportedOrientations(允許模态旋轉到任何指定取向)PropTypes.arrayOf(PropTypes.oneOf([‘portrait’, ‘portrait-upside-down’, ‘landscape’,’landscape-left’,’landscape-right’]))

  在iOS上,模态仍然受 info.plist 中的 UISupportedInterfaceOrientations字段中指定的限制。

2.modal 基本使用

  

3.modal 使用 —— 訓示器

效果圖

react-native modal