瀏覽代碼

Add keepStyleAcrossPush to documentation

Guy Carmeli 7 年之前
父節點
當前提交
e1b65cfc1a
共有 1 個文件被更改,包括 13 次插入0 次删除
  1. 13
    0
      docs/styling-the-navigator.md

+ 13
- 0
docs/styling-the-navigator.md 查看文件

@@ -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