Different background for each tab

Hi everybody.

How can I set a different background style for each tab using the tabs template?

I can’t simply define a style for each ion-content, it doesn’t work. So I have to wrap all tabs inside an ion-pane and then apply a background style for it, but it remains the same for all tabs.

I’ve tried to define styles to .scroll, .scroll-content, etc, but it appears for one sec when the app starts and then simply dissapears.

I hope you know how to address it.

Thank you guys.

Hi,

you can set your css style dynamically with ng-style.
https://docs.angularjs.org/api/ng/directive/ngStyle

Also you can set an image dynamically with ng-src.
https://docs.angularjs.org/api/ng/directive/ngSrc

1 Like