jfilter / react-native-onboarding-swiper

🛳 Delightful onboarding for your React-Native app
https://www.npmjs.com/package/react-native-onboarding-swiper
Other
971 stars 179 forks source link

Background image #102

Open mbuenaventurac opened 3 years ago

mbuenaventurac commented 3 years ago

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 commented 3 years ago

I have the same issue

HassaanShahzad98 commented 3 years ago

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 commented 2 years ago

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

serdarcevher commented 1 year ago

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)'