georstat / react-native-image-gallery

React Native Image Gallery with Thumbnails
MIT License
87 stars 19 forks source link

Make image galery SafeAreaView compatible #7

Open 404-html opened 2 years ago

404-html commented 2 years ago

Screenshot below shows phone with the notch and gallery running with header defined. Whole app is wrapped into SafeAreaView and renderHeaderComponent goes off.

Zrzut ekranu 2022-04-4 o 18 10 42

Here's header component from the screenshot:

const renderHeaderComponent = () => {
        return (
            <View
                style={{
                    height: 100,
                    width: '100%',
                    backgroundColor: 'white',
                }}>
                <Text>Hello World!</Text>
            </View>
        );
}
mmaass commented 1 year ago

as a workaround you can use SaveAreaView in the HeaderComponent

renderHeaderComponent={() => (
  <SafeAreaView>
    <View
      style={{
        height: 100,
        width: '100%',
      }}>
      <Button onPress={closeGallery} icon="close" mode="contained">
        schließen
      </Button>
    </View>
  </SafeAreaView>
)}