When using a ScrollView with a TopBar on iOS, the content inset is incorrect when drawBehind: true is set on the TopBar. If you hide the topBar, the content inset is correct.
The scrollview does move under the TopBar like it should, but the content is offset. If I am using drawBehind, I would expect the content offset to not be there, and I would have to adjust the offset manually.
// top bar style settings
topBar: {
visible: true,
translucent: true,
transparent: true,
drawBehind: true,
}
// RN render code
<ScrollView style={{flex:1, backgroundColor: 'limegreen'}} contentContainerStyle={{flexGrow: 1}}>
<View style={{flex: 1, backgroundColor: 'red'}}></View>
</ScrollView>
@jordanfloyd You can try and set contentInsetAdjustmentBehavior
on your scroll view:
<ScrollView contentInsetAdjustmentBehavior="never">...</ScrollView>
@adamterlson thank you. I had tried automaticallyAdjustContentInsets with no success, I didn't realize there was a different property for iOS 11+
Most helpful comment
@jordanfloyd You can try and set
contentInsetAdjustmentBehavior
on your scroll view:<ScrollView contentInsetAdjustmentBehavior="never">...</ScrollView>