react-native-htmlview
react-native-htmlview copied to clipboard
image and text position is not right.
I run the example, but the image and the text position is wrong. there is a a large blank above the image and the text display on the image.

same here

same here
Same here
<div>O técnico Tite, da seleção brasileira, anunciou uma surpresa nesta quarta-feira...</div>
<div></div>
<div>
<div class="wp-caption aligncenter">
<img ... />
<span>...</span>
</div>
</div>

"react": "16.8.3",
"react-native": "0.59.5",
"react-native-htmlview": "^0.14.0",
same here
I solved the problem by creating another component, it also lets you put the sup tag on Android devices: https://github.com/TiagoHellebrandt/react-native-htmlviewer
@TiagoHellebrandt could you please clarify how you are solved this particular problem? I'd appreciate if you post a code snippet. It seems contributors have no interest to fix this unfortunate problem
@TiagoHellebrandt could you please clarify how you are solved this particular problem? I'd appreciate if you post a code snippet. It seems contributors have no interest to fix this unfortunate problem
I solved the problem by wrapping the Image component with View component
here is the code
function _renderNode(node, index, siblings, parent, defaultRenderer) {
if (node.name === 'img') {
const a = node.attribs;
const dim = drawImageScaled(a);
return (
<View>
<Image
key={index}
source={{uri: a.src}}
style={{
width: dim.width,
height: dim.height,
}}
resizeMode={'center'}/>
</View>
);
}
}