Explorar el Código

Update README.md

iou90 hace 7 años
padre
commit
430faa5acc
Se han modificado 1 ficheros con 22 adiciones y 1 borrados
  1. 22
    1
      README.md

+ 22
- 1
README.md Ver fichero

@@ -3,5 +3,26 @@ An auto height webview for React Native.
3 3
 
4 4
 `npm install react-native-autoheight-webview --save`
5 5
 
6
-# android
6
+## android
7 7
 `react-native link react-native-autoheight-webview`
8
+
9
+## showcase
10
+![react-native-autoheight-webview](https://media.giphy.com/media/xUA7bj3KScXHeom1I4/giphy.gif) 
11
+![react-native-autoheight-webview](https://media.giphy.com/media/xUA7b4xTJ4FYX3RuZq/giphy.gif)
12
+
13
+# usage
14
+
15
+```javascript
16
+<AutoHeightWebView
17
+    onHeightUpdated={height => console.log(height)}
18
+    // or uri
19
+    source={{ html: `<p style="font-weight: 400;font-style: normal;font-size: 21px;line-height: 1.58;letter-spacing: -.003em;">Tags are great for describing the essence of your story in a single word or phrase, but stories are rarely about a single thing. <span style="background-color: transparent !important;background-image: linear-gradient(to bottom, rgba(146, 249, 190, 1), rgba(146, 249, 190, 1));">If I pen a story about moving across the country to start a new job in a car with my husband, two cats, a dog, and a tarantula, I wouldn’t only tag the piece with “moving”. I’d also use the tags “pets”, “marriage”, “career change”, and “travel tips”.</span></p>` }}
20
+    // use local or remote files
21
+    files={[{
22
+        href: 'cssfileaddress',
23
+        type: 'text/css',
24
+        rel: 'stylesheet'
25
+    }]}
26
+    // change script (have to change source to reload on android)
27
+    customScript={`document.body.style.background = 'lightyellow';`} />
28
+```