GithubHelp home page GithubHelp logo

Comments (7)

blazk0 avatar blazk0 commented on May 29, 2024

You need to wrap it in a Modal otherwise it wont show.

from react-native-image-viewer.

Xi-gofore avatar Xi-gofore commented on May 29, 2024

@blazk0 thanks, I tried the following the modal shows but the remote svg is not rendered on screen still.

<View>
  ...
  <Modal visible={true}>
        <ImageViewer
           width={winWidth}
           height={winHeight}
           enableImageZoom={true}
                imageUrls={svgImage} />
        </Modal>
</View>

Where the winWdith and winHeight are the width and height of the mobile simulator screen.

const winWidth = Dimensions.get('window').width;
 const winHeight = Dimensions.get('window').height;

(For example to render a remote SVG like this one https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/Steps.svg )

from react-native-image-viewer.

blazk0 avatar blazk0 commented on May 29, 2024

@Xi-gofore have you tried giving the svg width and height ?
if it does not show , then try using react native remote svg which gives you Image Component that supports svg.

Just use renderImage Prop in ImageViewer and use that Image Component.

from react-native-image-viewer.

Xi-gofore avatar Xi-gofore commented on May 29, 2024

@blazk0 Yes, I have tried giving svg width and height like :

const svgImage = [{ url: svgImg.url, width: winWidth, height: winHeight }];

The svg is not shown either.

The key feature for my project is not only showing the remote SVG image but also having pan-zoom feature. Do you have any suggestion about other libraries? What do you mean react native remote svg exactly? Could you please provide a link about that?

from react-native-image-viewer.

blazk0 avatar blazk0 commented on May 29, 2024

@Xi-gofore you are just changing the image component, i dont think it will affect the pan zoom feature.

here is the link : react-native-remote-svg

from react-native-image-viewer.

Xi-gofore avatar Xi-gofore commented on May 29, 2024

@blazk0 I tried that library, yes it renders the remote svg but no pan-zoom feature, but you said you don't think it affects pan zoom feature, how can I have the pan-zoom?

from react-native-image-viewer.

blazk0 avatar blazk0 commented on May 29, 2024

@Xi-gofore have you downloaded this lib ?

this package is dependent on it

from react-native-image-viewer.

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.