Browse Source

Add keepStyleAcrossPush to documentation

Guy Carmeli 7 years ago
parent
commit
e1b65cfc1a
1 changed files with 13 additions and 0 deletions
  1. 13
    0
      docs/styling-the-navigator.md

+ 13
- 0
docs/styling-the-navigator.md View File

@@ -20,6 +20,19 @@ export default class StyledScreen extends Component {
20 20
   }
21 21
 ```
22 22
 
23
+## Disabling persistent styling properties on iOS
24
+By design, most style properties on iOS are carried on to pushed screens. For example, If the navigation stack contains a single screen with `navBarButtonColor: 'blue'`; any screen pushed to this stack will have a blue `navBar` without needing to declare that property. This results in unpredictable and hard to determine style mechanism, therefore it wasn't implemented on Android.
25
+To disable this behavior on iOS, add `keepStyleAcrossPush: false` to `appStyle`:
26
+
27
+```js
28
+Navigation.startTabBasedApp({
29
+  ...
30
+  appStyle: {
31
+    keepStyleAcrossPush: false
32
+  }
33
+});
34
+```
35
+
23 36
 ## Setting styles dynamically
24 37
 Use the `setStyle` method to change a screen's style dynamically.
25 38