calintamas / react-native-toast-message

Animated toast message component for React Native
MIT License
1.72k stars 264 forks source link

On iOS Toast shows behind notch #247

Closed Pixele9 closed 3 years ago

Pixele9 commented 3 years ago

I have configured the Toast as it says in the docs. But it appears behind the notch when it is not triggered.

image

Is there a way to move it further back to prevent it from displaying? Any work around?

Thanks in advance!

younisabuzayed commented 3 years ago

If you use nativebase and wrap Toast. this is problem. You can wrap in react navigation no problem but nativebase no. this link you can find a solution : https://github.com/calintamas/react-native-toast-message#how-to-render-the-toast-when-using-react-navigation

nibblesnbits commented 3 years ago

@younisabuzayed, I've implemented the solution suggested, but it doesn't work. I still get the toast showing outside where SafeAreaView would render it.

image

younisabuzayed commented 3 years ago

Can you send code when you put " <Toast ref={(ref) => Toast.setRef(ref)} />" on in your code?

Pixele9 commented 3 years ago

In my case I solved it by moving the Toast component outside the SafeAreaView like this: image

ToshKoevoets commented 3 years ago

Also use when using on web and native, not possible to set opacity to 0 when in active? would be a lot more stable solution; my setup is a bit more layered

calintamas commented 3 years ago

Also use when using on web and native, not possible to set opacity to 0 when in active? would be a lot more stable solution; my setup is a bit more layered

@ToshKoevoets Starting with v2.0.0, opacity is indeed 0 when the Toast is not visible.

In my case I solved it by moving the Toast component outside the SafeAreaView like this: image

That's exactly right, the Toast instance has to be alongside NavigationContainer. More details can be found here - Usage with react-navigation.

I'll close the issue. If you find anything else, feel free to reopen.