I am trying to make my content start 100 px from the top in React Native. I have tried with
const OFFSET = 100const ScrollViewTest = (props) => (<ScrollView contentInset={{ top: OFFSET }} contentOffset={{ y: OFFSET }}><Text>Test</Text></ScrollView>)
But when I render the screen, it starts from 0 px, but if I scroll a little, it will scroll to 100px from the top and stay there.
So it seems React Native doen't trigger the contentOffset
and contentInset
properties on initialization.
How can I fix this? I have also tried setting automaticallyAdjustContentInsets={false}
with no changes.
Also, it seems these properties are for iOS only. Are there any similar properties for Android?