react native webview load from device local file system

后端 未结 5 1159
萌比男神i
萌比男神i 2020-12-07 21:08

I\'m trying to load .html, .js, .css files from device\'s local file system into React Native WebView component. I was able to get the

5条回答
  •  时光说笑
    2020-12-07 21:54

    I was able to include html5/javascript into project by using { html: , baseUrl: } as source. But to be frank, it's more like a lucky shot.

    I have index.html, which require pano2vr_player.js and pano.xml to make this code work.

    const HTML = `
    
    	
    		
    		
    		
    		
    		
    		
    		
    		
    	
    	
    		
    		

    Loading...

    This content requires HTML5 with CSS3 3D Transforms or WebGL.
    `; class PanoView extends Component { render() { return ( ); } }

    And finally add files/folder ('/web' same as baseUrl) to XCode project

    And it works! But I'm not sure how...

提交回复
热议问题