深色主题不适用于react本机android应用程序的webview

深色主题不适用于react本机android应用程序的webview,webview,react-native-android,android-dark-theme,Webview,React Native Android,Android Dark Theme,React Native expo应用程序的黑暗主题设置正确,在任何地方都能正常工作,但当我打开主题切换到黑暗时,除web视图外,所有内容都能完美工作 如何使webview部件在按钮开关上转换为黑色主题 这是我的代码,是否有任何if条件应用于代码以允许jscode 有点新的反应本机。。。如果解释不清楚,请告诉我 /**@格式*/ 从“React”导入React,{PureComponent}; 从“react native”导入{View}; 从“react native WebView”导入

React Native expo应用程序的黑暗主题设置正确,在任何地方都能正常工作,但当我打开主题切换到黑暗时,除web视图外,所有内容都能完美工作

如何使webview部件在按钮开关上转换为黑色主题

这是我的代码,是否有任何if条件应用于代码以允许jscode

有点新的反应本机。。。如果解释不清楚,请告诉我

/**@格式*/
从“React”导入React,{PureComponent};
从“react native”导入{View};
从“react native WebView”导入{WebView};
从“@common”导入{Color,Styles,withTheme};
从“@containers”导入{CustomPage};
从“/IconNav”导入{Menu,NavBarLogo,Back};
@主题
导出默认类CustomPageScreen扩展PureComponent{
静态导航选项=({navigation})=>{
const headerStyle=navigation.getParam(
“头型”,
Styles.Common.toolbar()
);
const dark=navigation.getParam(“暗”,false);
const isBack=navigation.getParam(“isBack”,false);
返回{
headerTitle:NavBarLogo({navigation}),
headerLeft:isBack?Back(导航):菜单(黑色),
HeaderIntColor:Color.HeaderIntColor,
头型,
headerStyle:Styles.Common.headerStyle,
};
};
不安全的_组件willmount(){
常数{
主题:{
颜色:{background},
黑暗的,
},
}=这是道具;
this.props.navigation.setParams({
headerStyle:Styles.Common.toolbar(背景,黑色),
黑暗的,
});
}
组件将接收道具(下一步){
if(this.props.theme.dark!==nextrops.theme.dark){
常数{
主题:{
颜色:{background},
黑暗的,
},
}=下一步;
this.props.navigation.setParams({
headerStyle:Styles.Common.toolbar(背景,黑色),
黑暗的,
});
}
}
render(){
const{state}=this.props.navigation;
if(typeof state.params==“未定义”){
返回;
}
让jsCode=`
document.querySelector('header').style.display='none';
document.querySelector('footer').style.display='none';
document.querySelector('#back_to_top')。style.display='none';
document.querySelector('ul.heateor_sss_sharing_ul')。style.display='none';
document.querySelector('.default_template_holder')。style.marginTop='-30px';
document.querySelector('.default_template_holder')。style.marginBottom='-50px';
document.querySelector('#qlwapp').style.display='none';
document.querySelector('div#onesignal bell container')。style.display='none';
`;
if(typeof state.params.url!=“未定义”){
返回(
);
}
返回(
);
}
}