react-native-html-webview icon indicating copy to clipboard operation
react-native-html-webview copied to clipboard

Display image from local system

Open crysfel opened this issue 10 years ago • 2 comments

Is there any way I can display an image from the local system inside of the webview? Basically I want to download some images from my server and display them on the webview, mainly to support offline mode and also performance.

crysfel avatar Oct 16 '15 18:10 crysfel

One way is to build a base64 data url for the image and include that as part of the HTML (or inject it in via JavaScript later)

almost avatar Oct 18 '15 21:10 almost

For those who come here after searching for a way to put local images in a react-native webview. You can put a local webpage including local images as reference in your xcode project and reference your image in the page via ./images/myimage.jpg. In other words drag and drop your webpage and image folder in your xcode project. Hopefully it helps someone.

virgial avatar Nov 08 '15 17:11 virgial