react-native-navigation的迁移库

options-background.mdx 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. ---
  2. id: options-background
  3. title: Background Options
  4. sidebar_label: Background
  5. ---
  6. Controls the top bar background styling.
  7. ```js
  8. const options = {
  9. topBar: {
  10. background: {}
  11. }
  12. };
  13. ```
  14. ### `color`
  15. Set the background color. Ignored if a component is specified.
  16. | Type | Required | Platform |
  17. | ----- | -------- | -------- |
  18. | Color | No | Both |
  19. ### `component`
  20. Set a react [component](layout-component.mdx) as the background. Useful when you need to show a gradient as background, for instance.
  21. On Android, setting an `id` to the Component will prevent the component from being recreated each time it's used by a screen. The component will be created once and whenever possible it will be reused.
  22. | Type | Required | Platform |
  23. | ---------------------- | -------- | -------- |
  24. | [Component](layout-component.mdx) | No | Both |
  25. ### `clipToBounds`
  26. Clip the top bar background to bounds if set to true.
  27. | Type | Required | Platform |
  28. | ------- | -------- | -------- |
  29. | boolean | No | iOS |
  30. ### `translucent`
  31. Allows the NavBar to be translucent (blurred).
  32. | Type | Required | Platform |
  33. | ------- | -------- | -------- |
  34. | boolean | No | iOS |
  35. ### `blur`
  36. Enable background blur.
  37. | Type | Required | Platform |
  38. | ------- | -------- | -------- |
  39. | boolean | No | iOS |