react-native-htmlview
react-native-htmlview copied to clipboard
Only half width of an img is being clickable if placed under <a/> tag of html
if i place an img tag inside a tag of my html only 50% of img width is being clickable i tried with different widths still no change only half of it is getting clickable
+1
if (node.name == "img") {
return (
<Image key={index} source={{uri: node.attribs.src}} style={{width: WinWidth,height:WinHeight}}/>
);
}
but half width of window
i use react-native-render-html last
it works for me
<Text
key={index}
onPress={() =>
this.clickImage(node.attribs.src)
}
>
<Image
source={{ uri: node.attribs.src}}
style={{ width: 100, height: 100, resizeMode: "cover" }}
/>
// !!!!!!!
</Text>
like this,i have resolve add a <View>
` <HTMLView renderNode={(node: HTMLViewNode, idx) => { if (node.name == 'img') { const a = node.attribs; return ( <View key={idx}> <Image resizeMode="cover" style={{ resizeMode: 'cover', width: mpx(20), height: mpx(20), }} source={{uri: a.src}} /> </View> ); } }} value={messageBody?.text as string} />
`