Giter VIP home page Giter VIP logo

Comments (16)

MichelDiz avatar MichelDiz commented on June 1, 2024 2

I gonna try!
PS. Does it work with PNG?

My data is:
<p><img src="https://appdopelo.tk/service/img/cms/logo_new_light.png" width="289" height="221" alt="logo_new_light.png" /></p>

"dependencies": {
"react": "~15.4.2",
"react-addons-shallow-compare": "^15.4.2",
"react-native": "^0.42.0",
"react-native-carousel-component": "^0.0.16",
"react-native-fence-html": "^1.0.6",
"react-native-html-converter": "^1.0.4",
"react-native-htmlview": "^0.5.0",
"react-native-scrollable-tab-view": "^0.6.0",
"react-native-tab-navigator": "^0.3.3",
"react-native-vector-icons": "^4.0.0",
},

console.log(carouselDescription); >>>
Object {$$typeof: Symbol(react.element), key: null, ref: null, props: Object, type: function…}
$$typeof
:Symbol(react.element)
key: null
props: Object
onError: function ()
onLinkPress: function openURL(url)
style:,Array(2)
stylesheet: Object
a: 58 
actions: 60
container: 54
contentContainer: 59
description: 56
img: 57
title: 55
__proto__ : Object
value:"<p><img src="https://appdopelo.tk/service/img/cms/cms-img.jpg" alt="" width="370" height="192" /></p>↵<p><span><span class="label-tooltip" title="">Descrição completa</span>"
__proto__ :Object
ref: null
type: function (props, context, updater)
_owner: ReactCompositeComponentWrapper
_store: Object
_self : null
_source: null
__proto__: Object

Not working

from react-native-htmlview.

liezl200 avatar liezl200 commented on June 1, 2024 2

With width and height set, img tag rendering works for Android. However I'm still having the issue that the same image is not rendering on iOS (there is a blank space where the image should be).

EDIT: nevermind, it was an iOS issue with loading images over http. I configured App Transport Security differently in Info.plist. See here for more info

from react-native-htmlview.

jsdf avatar jsdf commented on June 1, 2024 1

In the version which I just released, this works:

    <img src="https://i.redd.it/1l01wjsv22my.jpg" width="400" height="400" />

Not setting the dimensions may also work (but is experimental)

from react-native-htmlview.

XHTeng avatar XHTeng commented on June 1, 2024

had solve this issues ?

from react-native-htmlview.

nobalmohan avatar nobalmohan commented on June 1, 2024

React native support Image tag.

          <Image
            style={{width: 150, height: 150}}
            source={{uri: imgUrl}}
          />

from react-native-htmlview.

susan-github avatar susan-github commented on June 1, 2024

Any update about supporting tag?
react-native version: 0.38

from react-native-htmlview.

anishtr4 avatar anishtr4 commented on June 1, 2024

does it support <img src="https://dz2cdn2.dzone.com/thumbnai.jpg" width="60"> tag ?

from react-native-htmlview.

vedovato avatar vedovato commented on June 1, 2024

i think it's not supported, yet

from react-native-htmlview.

MichelDiz avatar MichelDiz commented on June 1, 2024

no modules are supporting img tags... I'm trying hard and no success

from react-native-htmlview.

vedovato avatar vedovato commented on June 1, 2024

Can you tell us reasons it is hard, @MichelDiz?

from react-native-htmlview.

MichelDiz avatar MichelDiz commented on June 1, 2024

Well I have a REST API that the app consume the Json data. I create a serie of mapping, reducing and Loop to organize and share the amount of data. I use a Carousel Component from 'react-native-carousel-component' to show a card with the information passed through props.

something like API > props > datasource > cloneWithRows this.props.data > renderRow > onPress={() => { this.showCarouselManager(val); }} > description

showCarouselManager = (rowData, val) => {
const options = {
cards: this.cards2(rowData),
},
};

and so on

then I use some module like:
import HTML from 'react-native-fence-html'; Works only text the best so far
import HTML from 'react-native-html-converter'; No sucess even with text
import HTML from 'react-native-htmlview'; Works only text
import HTML from 'react-native-webview'; No sucess
import HTML from 'react-native-webview-android; No sucess

inside the react-native-Carousel-Component I edit the component CarouselCard.js

const carouselDescription = description ? (
  <HTMLView 
    value={description} 
      stylesheet={styles.descriptionStyle}
      style={[styles.description, descriptionStyle]}
  />
) : null;

from react-native-htmlview.

jsdf avatar jsdf commented on June 1, 2024

This package supports img tag but the width and height attributes must be set.

from react-native-htmlview.

MichelDiz avatar MichelDiz commented on June 1, 2024

Okay, but where? inside my Json.description has width="203" height="214" inside the HTML

from react-native-htmlview.

CabuxaMapache avatar CabuxaMapache commented on June 1, 2024

Not working for me with "onRenderNode": #94

from react-native-htmlview.

vedovato avatar vedovato commented on June 1, 2024

How are you setting the image dimensions on dynamic content, @liezl200?

from react-native-htmlview.

nicqchen avatar nicqchen commented on June 1, 2024

if we add img with relative path, could add one base URL ? then we could check if it is from web. if not. use base URL to load images.

from react-native-htmlview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.