react-native-htmlview icon indicating copy to clipboard operation
react-native-htmlview copied to clipboard

image and text position is not right.

Open denghuijie opened this issue 6 years ago • 7 comments

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. image

denghuijie avatar Jan 07 '19 10:01 denghuijie

same here

bug

DeVoresyah avatar Jan 31 '19 19:01 DeVoresyah

same here

lonhui avatar Mar 07 '19 02:03 lonhui

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>

Screen Shot 2019-06-27 at 13 54 48

"react": "16.8.3",
"react-native": "0.59.5",
"react-native-htmlview": "^0.14.0",

rochapablo avatar Jun 27 '19 16:06 rochapablo

same here

TiagoHellebrandt avatar Jul 16 '19 13:07 TiagoHellebrandt

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 avatar Jul 18 '19 23:07 TiagoHellebrandt

@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

anisimov74 avatar Jul 30 '20 10:07 anisimov74

@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>
			);
		}
	}

hadidm avatar Sep 23 '21 06:09 hadidm