7

I'm developing an App using Ionic 2. Right now, I've this style:

ion-content {
  background-image: url('/assets/images/orange-background.svg');
  background-repeat: no-repeat;
  background-size: 101%;
}

When I ionic serve this works fine, but when I upload a new version to Ionic View channel, this example doesn't work neither any example of background-image with an .svg.

I already tried Ionic - svg does not appear but didn't work.

Thanks in advance.

Edit 1

I already tried this url in background-image:

assets/images/orange-background.svg
/assets/images/orange-background.svg
../assets/images/orange-background.svg
./assets/images/orange-background.svg

None of this worked :'(

Edit 2

I just discovered that this problem only happens on iOS.

Rodrigo Chaves
  • 1,094
  • 8
  • 23

2 Answers2

0

Maybe the url is incorrect. In the .css files: url ('../assets/images/orange-background.svg').

In other case, did you make the difference: In Whindows an image.SVG will works when you test the app in a browser but wont in Linux (Also Android). It seems that an image.SVG is the same as image.svg in windows.

0

I had a similar problem, and I realized that the file was called "Background.svg", and on my css I had:

background-image: url("../assets/imgs/background.svg");

Once I changed the file name to "background.svg" the problem was fixed.