react-native-navigation的迁移库

options-stack.mdx 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. ---
  2. id: options-stack
  3. title: Top Bar Options
  4. sidebar_label: Top Bar
  5. ---
  6. ## TopBar
  7. ```js
  8. const options = {
  9. topBar: {
  10. animate: true,
  11. title: {},
  12. subtitle: {},
  13. backButton: {},
  14. background: {}
  15. }
  16. };
  17. ```
  18. ### `animate`
  19. Determines if changing the TopBar visibility will be animated or not.
  20. | Type | Required | Platform |
  21. | ------- | -------- | -------- |
  22. | boolean | No | Both |
  23. ### `title`
  24. Controls the top bar title.
  25. | Type | Required | Platform |
  26. | ---------------------- | -------- | -------- |
  27. | [Title](options-title.mdx) | No | Both |
  28. ### `subtitle`
  29. Controls the top bar subtitle.
  30. | Type | Required | Platform |
  31. | ---------------------------- | -------- | -------- |
  32. | [Subitle](options-subtitle.mdx) | No | Both |
  33. ### `backButton`
  34. Controls the top bar back button.
  35. | Type | Required | Platform |
  36. | --------------------------------- | -------- | -------- |
  37. | [BackButton](options-backButton.mdx) | No | Both |
  38. ### `background`
  39. Controls the top bar background.
  40. | Type | Required | Platform |
  41. | --------------------------------- | -------- | -------- |
  42. | [Background](options-background.mdx) | No | Both |
  43. ### `barStyle`
  44. Control the TopBar blur style. Requires `translucent: true`.
  45. | Type | Required | Platform |
  46. | ----------------------- | -------- | -------- |
  47. | enum('default','black') | No | iOS |
  48. ### `borderColor`
  49. Change the topBar border color.
  50. | Type | Required | Platform |
  51. | ----- | -------- | -------- |
  52. | Color | No | iOS |
  53. ### `borderHeight`
  54. Set the border height of the navbar in dp.
  55. | Type | Required | Platform |
  56. | ------ | -------- | -------- |
  57. | number | No | Android |
  58. ### `drawBehind`
  59. Controls if child should be drawn behind the TopBar or below it.
  60. | Type | Required | Platform |
  61. | ------- | -------- | -------- |
  62. | boolean | No | Both |
  63. ### `elevation`
  64. Set the elevation of the TopBar in dp. This option changes how the shadow under the TopBar looks. Setting this value to 0 will remove the shadow completely.
  65. | Type | Required | Platform |
  66. | ------ | -------- | -------- |
  67. | number | No | Android |
  68. ### `hideOnScroll`
  69. Hide the TopBar when a scrolling layout is scrolled.
  70. | Type | Required | Platform |
  71. | ------- | -------- | -------- |
  72. | boolean | No | Both |
  73. ### `hideNavBarOnFocusSearchBar`
  74. Indicates whether the navigation bar should be hidden when searching. True by default.
  75. | Type | Required | Platform |
  76. | ------- | -------- | -------- |
  77. | boolean | No | iOS 11+ |
  78. ### `leftButtons`
  79. An array of buttons to be displayed at the right-side of the TopBar. Button layout is from left to right. See the [Buttons](button-options) section for more details.
  80. :::info Android support
  81. Android currently only supports a single left button and does not support custom left Buttons.
  82. :::
  83. | Type | Required | Platform |
  84. | ------------------------------ | -------- | -------- |
  85. | [[Button]](options-button.mdx) | No | Both |
  86. ### `leftButtonColor`
  87. Default color for left buttons.
  88. | Type | Required | Platform |
  89. | ----- | -------- | -------- |
  90. | Color | No | Both |
  91. ### `noBorder`
  92. Disables border at the bottom of the TopBar.
  93. | Type | Required | Platform |
  94. | ------- | -------- | -------- |
  95. | boolean | No | iOS |
  96. ### `rightButtons`
  97. An array of buttons to be displayed at the right side of the TopBar. Button layout is from right to left. See the [Buttons](button-options) section for more details.
  98. | Type | Required | Platform |
  99. | -------------------------- | -------- | -------- |
  100. | [[Button]](options-button.mdx) | No | Both |
  101. ### `rightButtonColor`
  102. Default color for the right button.
  103. | Type | Required | Platform |
  104. | ----- | -------- | -------- |
  105. | Color | No | Both |
  106. ### `searchBar`
  107. Shows the UISearchBar in the TopBar.
  108. | Type | Required | Platform |
  109. | ------- | -------- | -------- |
  110. | boolean | No | iOS 11+ |
  111. ### `searchBarHiddenWhenScrolling`
  112. Hides the UISearchBar when scrolling.
  113. | Type | Required | Platform |
  114. | ------- | -------- | -------- |
  115. | boolean | No | iOS 11+ |
  116. ### `searchBarPlaceholder`
  117. The placeholder value in the UISearchBar.
  118. | Type | Required | Platform |
  119. | ------ | -------- | -------- |
  120. | string | No | iOS 11+ |