react-native-safe-area-context icon indicating copy to clipboard operation
react-native-safe-area-context copied to clipboard

Edges feature doesn't seems to work for me.

Open lucien-perouze-cezembre opened this issue 5 years ago • 4 comments

I'm trying to cancel bottom padding on my safe View by adding edges on top, left and right only. It doesn't seems to have any effect on the view. My device is an emulated Iphone X.

The safe view is in a header in a ScrollView with an absolute position. My goal is to have a transparent header over a scrollable page that gain opacity on scroll.

<ScrollView style={style.container} stickyHeaderIndices={[0]} onScroll={onScroll}>
  <View style={style.header}>
    <View style={style.headerBackground} />
    <SafeAreaView edges={['right', 'top', 'left']} style={{ backgroundColor: 'blue' }}>
      <View style={style.headerContainer}>
        <Header onBack={navigation.goBack} />
      </View>
    </SafeAreaView>
  </View>

  ...

</ScrollView>

The result is a blue header with padding on bottom. Exactly the same with or without edges. And the same appears with bottom edges or anything.

lucien-perouze-cezembre avatar Jun 02 '20 09:06 lucien-perouze-cezembre

Got a similar issue;

<SafeAreaView
        edges={['bottom']}
        style={{ backgroundColor: 'red' }}>
        <View style={styles.container}>
          <Text>It seems you are disconnected from the internet</Text>
          <Text>Parts of this app might not work as expected</Text>
        </View>
      </SafeAreaView>

No combination of edges I provide does anything. It adds the spacing regardless.

sudomann avatar Jun 05 '20 04:06 sudomann

What version are you using? It works for me on RN 0.62.2 after upgrading this package to 3.0.2.

mariuswestgaard avatar Jun 05 '20 17:06 mariuswestgaard

@mariuswestgaard RN 0.62.2 and this package is 3.0.2.

I don't know where I could possibly investigate the cause of this.

sudomann avatar Jun 07 '20 04:06 sudomann

I've made a mistake. For unrelated reasons, this package was actually on version 1.0.0 despite me having 3.0.2 in my package.json. I corrected that and the edges prop worked properly.

sudomann avatar Jun 07 '20 04:06 sudomann

This is for v3 of the library, and we're on v4. Please re-open a new issue if you're still facing issues

jacobp100 avatar Jan 19 '23 16:01 jacobp100