我正在使用webview,当我提供错误的网址时,它会给warnig我想删除这个warnig并且只显示在本地未找到的页面 我的代码是
<WebView style={{flex:1,margin:20}}
ref={WebView_Ref}
source={{uri: 'https://www.gooef.com'}}
/>
我想在上面的url webview显示只找到页面没有给出warnig Err_connection_refused url错误
答案 0 :(得分:0)
使用renderError道具。
const errorPage = () =>{
return (
<Text>{'page not found '}</Text>
)
}
//..
<WebView
renderError={errorPage}
style={{flex:1,margin:20}}
ref={WebView_Ref}
source={{uri: 'https://www.gooef.com'}}
/>