Hi,
I’m new with Ionic 2. I’m trying to set background to the view.
I have an image in www/img and in scss I set the background with this code:
.login {
background: linear-gradient(
rgba(0, 0, 0, 0.75),
rgba(0, 0, 0, 0.1)
), url(/img/sfondologin.jpg);
background-repeat: no-repeat;
background-size: cover;
background-position: center;
width: 100%;
height: auto;
z-index: 2;
position: relative;
}
With command ionic serve I see the image in the browser. The problem is when I run the app in android device or ios simulator.
I have this error:
Failed to load resource: net::ERR_FILE_NOT_FOUND (file:///img/sfondologin.jpg)
Can you help me?
Thanks,
Stefano