vault-development / react-native-svg-uri

Render SVG images in React Native from an URL or static file
849 stars 334 forks source link

I cannot show static svg file in ios. #74

Open ok713 opened 7 years ago

ok713 commented 7 years ago

I have tried to show static svg file. but nothing have been showed. here is a my code.

<SvgUri width="30" height="30" source={ require('../../images/setting.svg')} />

please help me.

gitlovenotwar commented 7 years ago

I had the same issue.

manishoo commented 7 years ago

same

matc4 commented 7 years ago

Can you check with the new release. Thanks

adamski commented 7 years ago

I had this issue after updating RN, fixed it with #76

SubeerVerma commented 7 years ago

@adamski I updated the RN and RNSVG(as per the comment in #76 ), I am unable to render the static svg file.

Here is the code: <View style={{ flex: 1 }}> <SvgUri style={{ width: 200, height: 200 }} source={require('./img/.svg')} />

Please help.

adamski commented 7 years ago

@SubeerVerma have you tried e.g.

<SvgUri
  width: 200, 
  height: 200,
  source={require('./img/myImage.svg')}
/>
spearmootz commented 6 years ago

confirmed. i cannot render my static file

GopiKrishna10 commented 6 years ago

Hi @spearmootz ,

    Have you solve that SVG Issue.because i'm also facing same problem here. could you please help .
ziyafenn commented 6 years ago

So, for examle, when i use a simple icon with 1 fill, all works good. But when i use a flag, with bit more complex svg, then it doesn't render.

Here is an example code of SVG of flag i've used and that doesn't render

<svg xmlns="http://www.w3.org/2000/svg" height="480" width="640" viewBox="0 0 640 480">
  <path d="M0 0h640v160H0z" fill="red"/>
  <path d="M0 160h640v160H0z" fill="#00f"/>
  <path d="M0 320h640v160H0z" fill="orange"/>
</svg>

Getting warning:

RawText "" must be wrapped in an explicit

FireyFly commented 6 years ago

@ziyafenn you could try with all the whitespace between elements removed (i.e. all elements on one line). (as a workaround. ideally the library would properly handle whitespace between elements, treating it the same as no whitespace.)