Bläddra i källkod

Document usage of drawBehind when toggling BottomTabs visibility

Guy Carmeli 6 år sedan
förälder
incheckning
11e2306573
1 ändrade filer med 24 tillägg och 0 borttagningar
  1. 24
    0
      docs/docs/layout-types.md

+ 24
- 0
docs/docs/layout-types.md Visa fil

@@ -123,6 +123,30 @@ Navigation.mergeOptions(this.props.componentId, {
123 123
 });
124 124
 ```
125 125
 
126
+### Changing BottomTabs visibility
127
+The `visible` property can be used to control the BottomTab visibility.
128
+
129
+On **Android**, Visibility can be toggled dynamically using the `mergeOptions` command. When hiding BottomTabs, `drawBehind: true` should be specified in order for the screen to render behind the area which was previously allocated to the BottomTabs.
130
+
131
+```js
132
+Navigation.mergeOptions(componentId, {
133
+  bottomTas: visible: false,
134
+  ...Platform.select({ android: { drawBehind: true } })
135
+});
136
+```
137
+
138
+On **both** platforms visibility can be changed when pushing screens into a stack which is a direct child of a `BottomTabs` layout:
139
+
140
+```js
141
+Navigation.push(componentId, {
142
+	component: {
143
+	  name: 'pushedScreen',
144
+	  options: { bottomTas: visible: false }
145
+	}
146
+  });
147
+```
148
+
149
+
126 150
 ### Updating options for a specific tab
127 151
 Updating (merging) tab specific options is done using the `mergeOptions` command. `mergeOptions` expects a `componentId` as first argument, therefore in order to update a specific tab we'll need to pass a `componentId` of a child of that specific tab.
128 152
 For example, Using the layout specified above, To update the `badge` property of the second tab we'll call `mergeOptions` with `SecondScreenId`.