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

[ScrollView] Why the top of ScrollView has more than 20 pixels

Open cssoul opened this issue 11 years ago • 9 comments

ScrollView Bug

cssoul avatar Jul 20 '15 04:07 cssoul

Code:

<ScrollView
        ref='scrollWrap'
        stickyHeaderIndices={[3]}
        style={styles.scrollView}>
    <Banner data={jsonData.banner} />
    .......
</ScrollView>

cssoul avatar Jul 20 '15 04:07 cssoul

I use this code to Solved this problems contentContainerStyle={{marginTop:-20}}

... ...

cssoul avatar Jul 20 '15 05:07 cssoul

I met the same issue.It's ok in 0.6.0.So what's the change in 0.8.0 to cause this issue?

Nirvana-icy avatar Jul 20 '15 06:07 Nirvana-icy

To my case, this issue is found since 0.7.1

keyhui-heha avatar Jul 20 '15 06:07 keyhui-heha

That's duplicate of https://github.com/facebook/react-native/issues/1779, try

contentInset={{top:0}}
automaticallyAdjustContentInsets={false}

grabbou avatar Jul 20 '15 13:07 grabbou

We should close this one and just keep the existing one live. @brentvatne close duplicate

MossP avatar Jul 20 '15 17:07 MossP

@MossP - thanks for pointing that out. I closed the other because it seems like that works for ListView now with the props that @grabbou suggested, but I personally was not able to fix this issue using those props on a ScrollView, so I'll keep this one open.

The only way I was able to get this to go away was to set a negative top margin :(

brentvatne avatar Jul 20 '15 17:07 brentvatne

I've been able to solve this issue by turning off translucency and wrapping the list view itself.

See https://github.com/facebook/react-native/issues/2151#issuecomment-128159054

jaygarcia avatar Aug 05 '15 21:08 jaygarcia

@ide @brentvatne Issue can be closed.

christopherdro avatar Sep 13 '15 23:09 christopherdro