Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 未在React Native WebView的HTML中应用有效的CSS_Reactjs_React Native_Webview_Android Webview - Fatal编程技术网

Reactjs 未在React Native WebView的HTML中应用有效的CSS

Reactjs 未在React Native WebView的HTML中应用有效的CSS,reactjs,react-native,webview,android-webview,Reactjs,React Native,Webview,Android Webview,我有一个用html和css制作的有效页面,当在浏览器上运行时,输出与预期一致。我试图在WebView中呈现该html页面,但是CSS样式没有被应用,我不明白为什么。我就是这样做的: public render() { const css = `<style> /* ...all css styling goes here */ </style>`; const html = `<body> /* ...all html goes here */

我有一个用html和css制作的有效页面,当在浏览器上运行时,输出与预期一致。我试图在
WebView
中呈现该html页面,但是CSS样式没有被应用,我不明白为什么。我就是这样做的:

public render() {
    const css = `<style> /* ...all css styling goes here */ </style>`;
    const html = `<body> /* ...all html goes here */ </body>`;
    return (
        <WebView
            originWhitelist={["*"]}
            source={{html: css + html}}
        />
    );
}
public render(){
常量css=`/*…所有css样式都在这里*/`;
常量html=`/*…所有html都放在这里*/`;
返回(
);
}
我错过了什么?正如我所说,css和html部分与页面中的部分完全相同,当我在浏览器中打开页面时,它工作得非常好