Hey @webteambel did you find any working solution for this? I’ve also tried via JS, but it wasn’t working for me neither. And If I leave it with css the screen is flickering/flashing if i ran on iOS device (or Safari, or anything related with iOS. On Android is running well)
Thanks, it worked for me , at least the flickering effect is gone. But, I have to ask you guys another question, maybe you can help me out.
On iOS device (it’s an iPhone 6s) I have an issue with the bouncing effect when I am testing (building out the app, and running from xCode on a connected device), I can’t disable the bounce from top to bottom and bottom to top, neither in ion-content nor in config.xml. I tried a lot of “tricks”. None of them worked.
FYI.: I updated everything, angular, ionic, ionic cli, dependencies (some of them had to be updated manually).
Both Github issues have been locked so it’s not possible to add this comment there, but anyways…
Just in case if this could help some other devs, another option is to use CSS Shadow Parts since the content exposes the background in that way.
ion-content {
// Workaround for issue related to css varialbes
// being recalculated with DOM changes
// https://github.com/ionic-team/ionic-framework/issues/17494
// https://github.com/ionic-team/ionic-framework/issues/16678
&::part(background) {
background: url('...') no-repeat center center / cover;
}
...
...
}
@daivinod Thanks for posting, this looks like a promising solution but I am unable to get it to work. The HTML is clearly reading the path because if I mess it up it throws a 404 error, but the image itself isn’t displaying. Any thoughts? One thing I noticed is that in the constructor you setup (private router: Router) but that is grayed out in my code and isn’t used. Is that not part of this solution?
I also tried it programmatically in ts as laid out here: css - How to put image in both <ion-header> and <ion-content> in Ionic - Stack Overflow
This worked, but only for one page. I get into the ionViewWillEnter not firing in iOS bug (feature)(works great in the browser) when I try to set a different background image on another page. Hope this isn’t TMI but I’m at my wits end!
It appears this is broken for users with older versions of iOS <13 I guess, they just get a white background. Unfortunately my text was white also so it is unusable.
I’m currently looking for a solution to this.
Is there a way to test on older iOS versions somehow without uninstalling my current (latest) version of xcode?