React-native – How to load images in the source code directory to WebView in React Native Android

When I try to load an image from the web to the webview, it works fine as shown below.

Hello

" }} />

But I can’t put the source code directory Load the images in Webview. I tried to use the following code.

Hello

" }} />

If anyone knows how to load images from the source code directory, please let me know.

< div class="content-split">

insert
allowFileAccess = {TRUE}
To your web page view:

< /p>

 allowFileAccess={true}
source={{"\"\"}}
style={{marginTop: 20 }}
/>

AllowFileAccess: Its boolean value sets whether WebView can access the file system. This will help your application access the file system from external storage.

< /div>

When I try to load the image from the network to the webview, it works fine as shown below.

Hello

" }} />

But I cannot load the image in the source code directory to Webview. I tried to use the following code.

Hello

" }} />

If anyone knows how to get from the source Load images in the code directory, please tell me.

Insert
allowFileAccess = {TRUE}
Go to your web page view:

p>

 allowFileAccess={true}
source={{"\"\"}}
style ={{marginTop: 20}}
/>

AllowFileAccess: Its Boolean value sets whether the WebView can access the file system. This will help your application access the file system from external storage .

Leave a Comment

Your email address will not be published.