Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native app doesn't load @1x, @2x or @3x image to the right screen density

I am developing a iOS/Android app using React Native. According to the documentation at this link https://facebook.github.io/react-native/docs/images React native places the correct image size according to your device screen density.

When developing I do as the tutorial on the link above but react native bundles de img.png always and doesn't place the @2x or @3x image which are bigger.

I don't know if this is only done when the bundle is created for launching the app or so! Please help, I am struggling

Also, which is the better flux, process or way to design one screen size in psd and get all assets for multiple screen sizes from it?

Thanks in advance

like image 972
Carlos Yanes Avatar asked Sep 04 '25 17:09

Carlos Yanes


1 Answers

as react-native doc image should be named accordingly enter image description here

in development mode images will be bundled to app but you can link images in native project folder as drawable in android
so if you use different builds for your app you will use that density images

ps : a dirty workaround inorder to test your app in dev mode is, providing other image for @2x or @3x image sizes

like image 55
nima moradi Avatar answered Sep 07 '25 09:09

nima moradi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!