|
@@ -25,6 +25,7 @@ This document lays out the current public properties and methods for the React N
|
25
|
25
|
- [`onShouldStartLoadWithRequest`](Reference.md#onshouldstartloadwithrequest)
|
26
|
26
|
- [`startInLoadingState`](Reference.md#startinloadingstate)
|
27
|
27
|
- [`style`](Reference.md#style)
|
|
28
|
+- [`containerStyle`](Reference.md#containerStyle)
|
28
|
29
|
- [`decelerationRate`](Reference.md#decelerationrate)
|
29
|
30
|
- [`domStorageEnabled`](Reference.md#domstorageenabled)
|
30
|
31
|
- [`javaScriptEnabled`](Reference.md#javascriptenabled)
|
|
@@ -343,6 +344,7 @@ url
|
343
|
344
|
### `onHttpError`
|
344
|
345
|
|
345
|
346
|
Function that is invoked when the `WebView` receives an http error.
|
|
347
|
+
|
346
|
348
|
> **_Note_**
|
347
|
349
|
> Android API minimum level 23.
|
348
|
350
|
|
|
@@ -357,7 +359,10 @@ Example:
|
357
|
359
|
source={{ uri: 'https://facebook.github.io/react-native' }}
|
358
|
360
|
onHttpError={syntheticEvent => {
|
359
|
361
|
const { nativeEvent } = syntheticEvent;
|
360
|
|
- console.warn('WebView received error status code: ', nativeEvent.statusCode);
|
|
362
|
+ console.warn(
|
|
363
|
+ 'WebView received error status code: ',
|
|
364
|
+ nativeEvent.statusCode,
|
|
365
|
+ );
|
361
|
366
|
}}
|
362
|
367
|
/>
|
363
|
368
|
```
|
|
@@ -446,7 +451,7 @@ Example:
|
446
|
451
|
onContentProcessDidTerminate={syntheticEvent => {
|
447
|
452
|
const { nativeEvent } = syntheticEvent;
|
448
|
453
|
console.warn('Content process terminated, reloading', nativeEvent);
|
449
|
|
- this.refs.webview.reload()
|
|
454
|
+ this.refs.webview.reload();
|
450
|
455
|
}}
|
451
|
456
|
/>
|
452
|
457
|
```
|
|
@@ -602,6 +607,25 @@ Example:
|
602
|
607
|
|
603
|
608
|
---
|
604
|
609
|
|
|
610
|
+### `containerStyle`
|
|
611
|
+
|
|
612
|
+A style object that allow you to customize the `WebView` container style. Please note that there are default styles (example: you need to add `flex: 0` to the style if you want to use `height` property).
|
|
613
|
+
|
|
614
|
+| Type | Required |
|
|
615
|
+| ----- | -------- |
|
|
616
|
+| style | No |
|
|
617
|
+
|
|
618
|
+Example:
|
|
619
|
+
|
|
620
|
+```jsx
|
|
621
|
+<WebView
|
|
622
|
+ source={{ uri: 'https://facebook.github.io/react-native' }}
|
|
623
|
+ containerStyle={{ marginTop: 20 }}
|
|
624
|
+/>
|
|
625
|
+```
|
|
626
|
+
|
|
627
|
+---
|
|
628
|
+
|
605
|
629
|
### `decelerationRate`
|
606
|
630
|
|
607
|
631
|
A floating-point number that determines how quickly the scroll view decelerates after the user lifts their finger. You may also use the string shortcuts `"normal"` and `"fast"` which match the underlying iOS settings for `UIScrollViewDecelerationRateNormal` and `UIScrollViewDecelerationRateFast` respectively:
|