Przeglądaj źródła

Fix comments of path issue of baseUrl

iou90 5 lat temu
rodzic
commit
a09a7a8856
2 zmienionych plików z 6 dodań i 6 usunięć
  1. 3
    3
      README.md
  2. 3
    3
      autoHeightWebView/index.js

+ 3
- 3
README.md Wyświetl plik

39
     /*
39
     /*
40
     using local or remote files
40
     using local or remote files
41
     to add local files:
41
     to add local files:
42
-    add baseUrl/files... to android/app/src/assets/ on android
43
-    add baseUrl/files... to project root on iOS
42
+    add files to android/app/src/main/assets/ (depends on baseUrl) on android
43
+    add files to web/ (depends on baseUrl) on iOS
44
     */
44
     */
45
     files={[{
45
     files={[{
46
         href: 'cssfileaddress',
46
         href: 'cssfileaddress',
52
     // 'file:///android_asset/web/' by default on Android
52
     // 'file:///android_asset/web/' by default on Android
53
     // or uri
53
     // or uri
54
     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>` }}
54
     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>` }}
55
-    // false by default on Android (different from react-native-webview),
55
+    // false by default on iOS & Android (different from react-native-webview which true by default on Android),
56
     // when scalesPageToFit was assigned to true, it will apply page scale to size directly instead of using viewport meta script 
56
     // when scalesPageToFit was assigned to true, it will apply page scale to size directly instead of using viewport meta script 
57
     scalesPageToFit={true}
57
     scalesPageToFit={true}
58
     // only works on iOS when scalesPageToFit was false,
58
     // only works on iOS when scalesPageToFit was false,

+ 3
- 3
autoHeightWebView/index.js Wyświetl plik

89
 
89
 
90
 AutoHeightWebView.propTypes = {
90
 AutoHeightWebView.propTypes = {
91
   onSizeUpdated: PropTypes.func,
91
   onSizeUpdated: PropTypes.func,
92
-  // add baseUrl/files... to android/app/src/assets/ on android
93
-  // add baseUrl/files... to project root on iOS
92
+  // add files to android/app/src/main/assets/ (depends on baseUrl) on android
93
+  // add files to web/ (depends on baseUrl) on iOS
94
   files: PropTypes.arrayOf(
94
   files: PropTypes.arrayOf(
95
     PropTypes.shape({
95
     PropTypes.shape({
96
       href: PropTypes.string,
96
       href: PropTypes.string,
107
   onMessage: PropTypes.func,
107
   onMessage: PropTypes.func,
108
   // baseUrl now contained by source
108
   // baseUrl now contained by source
109
   // 'web/' by default on iOS
109
   // 'web/' by default on iOS
110
-  // 'file:///android_asset/web/' by default on Android
110
+  // 'file:///android_asset/' by default on Android
111
   source: PropTypes.object
111
   source: PropTypes.object
112
 };
112
 };
113
 
113