react-native-navigation的迁移库

options-stack.mdx 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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. ### `visible`
  19. Determines if TopBar is visible or not.
  20. | Type | Required | Platform |
  21. | ------- | -------- | -------- |
  22. | boolean | No | Both |
  23. ### `animate`
  24. Determines if changing the TopBar visibility will be animated or not.
  25. | Type | Required | Platform |
  26. | ------- | -------- | -------- |
  27. | boolean | No | Both |
  28. ### `title`
  29. Controls the top bar title.
  30. | Type | Required | Platform |
  31. | ---------------------- | -------- | -------- |
  32. | [Title](options-title.mdx) | No | Both |
  33. ### `subtitle`
  34. Controls the top bar subtitle.
  35. | Type | Required | Platform |
  36. | ---------------------------- | -------- | -------- |
  37. | [Subitle](options-subtitle.mdx) | No | Both |
  38. ### `backButton`
  39. Controls the top bar back button.
  40. | Type | Required | Platform |
  41. | --------------------------------- | -------- | -------- |
  42. | [BackButton](options-backButton.mdx) | No | Both |
  43. ### `background`
  44. Controls the top bar background.
  45. | Type | Required | Platform |
  46. | --------------------------------- | -------- | -------- |
  47. | [Background](options-background.mdx) | No | Both |
  48. ### `barStyle`
  49. Control the TopBar blur style. Requires `translucent: true`.
  50. | Type | Required | Platform |
  51. | ----------------------- | -------- | -------- |
  52. | enum('default','black') | No | iOS |
  53. ### `borderColor`
  54. Change the topBar border color.
  55. | Type | Required | Platform |
  56. | ----- | -------- | -------- |
  57. | Color | No | iOS |
  58. ### `borderHeight`
  59. Set the border height of the navbar in dp.
  60. | Type | Required | Platform |
  61. | ------ | -------- | -------- |
  62. | number | No | Android |
  63. ### `drawBehind`
  64. Controls if child should be drawn behind the TopBar or below it.
  65. | Type | Required | Platform |
  66. | ------- | -------- | -------- |
  67. | boolean | No | Both |
  68. ### `elevation`
  69. 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.
  70. | Type | Required | Platform |
  71. | ------ | -------- | -------- |
  72. | number | No | Android |
  73. ### `hideOnScroll`
  74. Hide the TopBar when a scrolling layout is scrolled.
  75. | Type | Required | Platform |
  76. | ------- | -------- | -------- |
  77. | boolean | No | Both |
  78. ### `hideNavBarOnFocusSearchBar`
  79. Indicates whether the navigation bar should be hidden when searching. True by default.
  80. | Type | Required | Platform |
  81. | ------- | -------- | -------- |
  82. | boolean | No | iOS 11+ |
  83. ### `leftButtons`
  84. 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.
  85. :::info Android support
  86. Android currently only supports a single left button and does not support custom left Buttons.
  87. :::
  88. | Type | Required | Platform |
  89. | ------------------------------ | -------- | -------- |
  90. | [[Button]](options-button.mdx) | No | Both |
  91. ### `leftButtonColor`
  92. Default color for left buttons.
  93. | Type | Required | Platform |
  94. | ----- | -------- | -------- |
  95. | Color | No | Both |
  96. ### `noBorder`
  97. Disables border at the bottom of the TopBar.
  98. | Type | Required | Platform |
  99. | ------- | -------- | -------- |
  100. | boolean | No | iOS |
  101. ### `rightButtons`
  102. 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.
  103. | Type | Required | Platform |
  104. | -------------------------- | -------- | -------- |
  105. | [[Button]](options-button.mdx) | No | Both |
  106. ### `rightButtonColor`
  107. Default color for the right button.
  108. | Type | Required | Platform |
  109. | ----- | -------- | -------- |
  110. | Color | No | Both |
  111. ### `searchBar`
  112. Shows the UISearchBar in the TopBar.
  113. | Type | Required | Platform |
  114. | ------- | -------- | -------- |
  115. | boolean | No | iOS 11+ |
  116. ### `searchBarHiddenWhenScrolling`
  117. Hides the UISearchBar when scrolling.
  118. | Type | Required | Platform |
  119. | ------- | -------- | -------- |
  120. | boolean | No | iOS 11+ |
  121. ### `searchBarPlaceholder`
  122. The placeholder value in the UISearchBar.
  123. | Type | Required | Platform |
  124. | ------ | -------- | -------- |
  125. | string | No | iOS 11+ |