Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to allow ScrollView in React Native to extend to the status bar area in IOS?

Tags:

react-native

I'm having trouble setting my ScrollView to extend to the status bar area .

for example

  return (
      <View  style={{flex:1}}>
      <ScrollView style={{flex:1}}>
      <Text>Random Text</Text>
      </ScrollView>
      </View>
    );

returns this for me , which bascially set the text right below the status bar area .

Current results

I was hopping to actually have it look like this.

Expected result

How can I got about achieving this ?

thank you in advance

like image 582
Master Betty Avatar asked Nov 02 '25 17:11

Master Betty


1 Answers

Adding

contentInsetAdjustmentBehavior="never"

to ScrollView does it.

  return (
      <View  style={{flex:1}}>
      <ScrollView
      contentInsetAdjustmentBehavior="never"
      style={{flex:1}}>
      <Text>Random Text</Text>
      </ScrollView>
      </View>
    )

https://github.com/wix/react-native-navigation/issues/3821

like image 181
Master Betty Avatar answered Nov 05 '25 10:11

Master Betty



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!