react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

[v2] ScrollView content always offsets from top by statusbarheight in iOS

Open rendomnet opened this issue 8 years ago • 6 comments

Issue Description

If I will make ScrollView take whole screen, then it content will always offsets from the top by the amount of statusbar height.

<ScrollView
        style={[
          {
            flex: 1,
            padding: 0,
            margin: 0,
            borderColor: "red",
            borderWidth: 1
          }
        ]}
      >
        <View
          style={{
            height: 300,
            borderColor: "green",
            borderWidth: 1
          }}
        />
</ScrollView>

image red border - is ScrollView green border - is children View inside ScrollView

Steps to Reproduce / Code Snippets / Screenshots

Make ScrollBar fill entire view and put children inside of it.


Environment

  • React Native Navigation version:2.0.2474
  • React Native version: 0.56.0
  • Platform(s) (iOS, Android, or both?): iOS
  • Device info (Simulator/Device? OS version? Debug/Release?): sim

rendomnet avatar Aug 22 '18 11:08 rendomnet

+1 Same problem

skyien avatar Aug 27 '18 19:08 skyien

+1 same issue

VicFrolov avatar Oct 05 '18 03:10 VicFrolov

same issue

nikolaigeorgie avatar Oct 05 '18 07:10 nikolaigeorgie

Adding the the prop contentInsetAdjustmentBehavior="never" to scrollview should solve the issue for devices using iOS 11+ . But the issue still persists with versions earlier than iOS 11 adding automaticallyAdjustContentInsets={false} doesn't seem to solve the issue, but a quick cheap fix is to just update the contentInsets contentInset={{ top: -20, left: 0, bottom: 0, right: 0 }}.

TomAtterton avatar Oct 05 '18 14:10 TomAtterton

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

stale[bot] avatar Nov 26 '18 13:11 stale[bot]

The issue has been closed for inactivity.

stale[bot] avatar Dec 03 '18 13:12 stale[bot]