jobtoday / react-native-image-viewing

Tiny, purely TS, modal component for viewing images 🏙
https://exp.host/@antonkalinin/react-native-image-viewing
MIT License
890 stars 290 forks source link

Is it possible to wrap SafeAreaView inside modal? #168

Closed inmess closed 1 year ago

inmess commented 1 year ago

When I try to customize the header component, here I found header is displaying outside the safe area.

image

Which is quite annoying, I don't want a non-fullscreen view in this situation. I did't fine any property or method to avoid this,

<SafeAreaView>
    <ImageView />
</SafeAreaView>

Code above is also not working because the <SafeAreaView> is outside the modal I guess. Anyone know how to solve this problem? thank you.

inmess commented 1 year ago

Sorry guys, I think it was my fault...

Firstly I tried wrap <SafeAreaView> to the customized header, It didn't work, then I thought it was a wrong way to do it.

Until I found <SafeAreaView> in default header component... The thing is, import { SafeAreaView } from 'react-native-safe-area-context' is not working, but import { SafeAreaView } from 'react-native' is working properly now. 😅 My bad