首页 > 解决方案 > 当我在渲染 HTML 后按下它时,不要在浏览器中显示图像

问题描述

在反应应用程序中,我必须呈现一些包含文本、链接和一些图像/视频的 html 代码。

我为此使用 react-native-render-html 。

有一种方法可以让链接通过 WebView 打开,但没有图像?

<View style={styles.testo_a}>
  <HTML html={this.state.text_} 
    onLinkPress= {(evt, href) => { <WebView source={{href}});/>}} 
    ignoredStyles={['width']}
    staticContentMaxWidth={Dimensions.get('window').width-10}
    imagesMaxWidth={Dimensions.get('window').width-10}/>
</View>

标签: imagereact-nativehtml-renderingreact-native-webview

解决方案


推荐阅读