Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background image #102

Open
mbuenaventurac opened this issue Feb 23, 2021 · 4 comments
Open

Background image #102

mbuenaventurac opened this issue Feb 23, 2021 · 4 comments

Comments

@mbuenaventurac
Copy link

Thanks for the component, very nice and easy to use!

I would like to set a background image for each page but I can't find the way to implement it. Is it possible to do?

@amrshadid
Copy link

I have the same issue

@HassaanShahzad98
Copy link

HassaanShahzad98 commented Aug 5, 2021

you can use conditional rendering for this by using pageIndexCallback prop:

in my case , I had two boarding screens with different background images
...
const [index, setindex] = useState(0);
const changePageHandler = (index: any) => {
setBoardingindex(index);
}

return (
<ImageBackground
source={index===0? require('assets/img1') : require('assets/img2')}
<Onboarding
pageIndexCallback={changePageHandler}
...

hope this helps!

@SamBosco
Copy link

how do we bypass the background color when adding the ImageBackground component ?

@serdarcevher
Copy link

how do we bypass the background color when adding the ImageBackground component ?

You can use a rgba background color with transparency: backgroundColor: 'rgba(255, 255, 255, 0.1)'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants