Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image doesn't show when the imageName contain spaces [IOS ONLY] #96

Open
saudpunjwani101 opened this issue Jan 15, 2018 · 2 comments
Open

Comments

@saudpunjwani101
Copy link

saudpunjwani101 commented Jan 15, 2018

Sample code,

      <CachedImage
        source={{uri: `https://${address}/House Clean.jpg`}} // doesn't work, when "Drinks.jpg" it works
       style={{width:190,height:130}}
       resizeMode={"cover"}
      />

When the image name contains spaces, the image won't show on IOS. It's working fine in Android.
This is not a styling issue, I'm certain of it, and also when using default Image component it works fine.
Any Idea why it happens?

@saudpunjwani101
Copy link
Author

replacing space character with '%20' solves the issue. If anyone has a better solution, please

@mayur-padshala
Copy link

Whenever using URLs, you should consider using encodeURIComponent() function. This issue happens with native iOS code also. So there is no better solution than using encodeURIComponent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants