react-native-navigation的迁移库

api-overlay.mdx 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. ---
  2. id: overlay
  3. title: Overlay
  4. sidebar_label: Overlay
  5. ---
  6. ## `showOverlay()`
  7. Shows a component as an overlay.
  8. | Name | Required | Type | Description |
  9. | ------ | -------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  10. | layout | Yes | [Layout](layout-layout.mdx) | Any type of layout. Typically, Component layout is used in Overlays but it's possible to load any other layout ([BottomTabs](layout-BottomTabs.mdx), [Stack](layout-stack.mdx), [SideMenu](layout-sideMenu.mdx), [Component](layout-component.mdx)) |
  11. ```js
  12. Navigation.showOverlay({
  13. component: {
  14. name: 'example.Overlay',
  15. options: {
  16. layout: {
  17. componentBackgroundColor: 'transparent',
  18. },
  19. overlay: {
  20. interceptTouchOutside: true
  21. }
  22. }
  23. }
  24. });
  25. ```
  26. ## `dismissOverlay()`
  27. Dismisses an overlay matching the given overlay componentId.
  28. #### Parameters
  29. | Name | Required | Type | Description |
  30. | ----------- | -------- | ------ | ------------------------------------- |
  31. | componentId | Yes | string | The component id presented in Overlay |
  32. ```js
  33. Navigation.dismissOverlay(this.props.componentId);
  34. ```