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

[ListView] Extra space at the top.

Open JinxMan25 opened this issue 11 years ago • 19 comments

I don't know if this is a styling issue, but there is some extra space (they're not rows because they're not selectable) at the top of the ListView. Is there any workaround this? And was this issue fixed within the last week?

screen shot 2015-04-07 at 12 09 52 pm

JinxMan25 avatar Apr 07 '15 16:04 JinxMan25

I guess automaticallyAdjustContentInsets strikes again. Try

<ListView automaticallyAdjustContentInsets={false} ... />

frantic avatar Apr 07 '15 18:04 frantic

That worked, thanks a bunch!

JinxMan25 avatar Apr 09 '15 18:04 JinxMan25

I have the same problem, mark this.

LeezQ avatar Apr 10 '15 03:04 LeezQ

Is this a bug or not?

umhan35 avatar May 01 '15 04:05 umhan35

Is automaticallyAdjustContentInsets documented anywhere? Why it's necessary etc...

joewood avatar May 05 '15 02:05 joewood

Seems like automaticallyAdjustContentInsets compensates for statusBarIOS and tabBarIOS (so that things can scroll properly and not be blocked by those fixed items) but it gets complicated if the scrollview isn't the first or last component.

rxb avatar May 13 '15 18:05 rxb

I was able to replicate this whenever I have a ScrollView (or ListView) with TabBarIOS at the bottom. If I put automaticallyAdjustContentInsets={false} the extra space at the top disappears but the scrollview doesn't scroll up all the way hiding the bottom contents of the ScrollView below the TabBarIOS

jedt avatar May 22 '15 15:05 jedt

@jedt, give the scroll view a contentInset of {bottom:49} or however tall your tab bar is, and the scrolling behavior should be fixed.

ide avatar May 22 '15 19:05 ide

Thanks @ide! it works perfectly :)

here is the code:

<ListView
  contentInset={{bottom:49}}
  automaticallyAdjustContentInsets={false}
>

jedt avatar May 22 '15 23:05 jedt

Has the team considered making automaticallyAdjustContentInsets={false} the default behavior of this component?

joeyyang avatar Jun 22 '15 00:06 joeyyang

@frantic - curious what you think about @joeyyang's suggestion above

brentvatne avatar Jun 23 '15 23:06 brentvatne

@jedt @ide Also, if you still can't see everything after doing that, make sure the container has flex: 1 - I forgot to do that I couldn't scroll more than (64 + 49)px!

wub avatar Jul 05 '15 01:07 wub

FWIW - you lose the translucency when scrolling content under the navigation bar - which makes sense when you think of how automaticallyAdjustContentInsets works.

admmasters avatar Jul 13 '15 13:07 admmasters

This should definitely be explained in the ListView docs at least. I.e. If using a tab bar with a list view etc...

broonage avatar Aug 03 '15 14:08 broonage

:+1: for the answer in this issue. :-1: for this being magic to users.

RWOverdijk avatar Aug 14 '15 15:08 RWOverdijk

Related: #1779 #2151

@brentvatne @ide

christopherdro avatar Sep 13 '15 23:09 christopherdro

I have a horizontal scroll view and getting extra bottom space. I changed height in style and contentContainerStyle but not work Anybody experienced same thing?

ghost avatar Jul 14 '16 08:07 ghost

The feature is good enough and somewhat necessary in most of the cases that ListView just placed under the Navigator, but the problem is the lack of documentation here .

hustshawn avatar Nov 04 '16 02:11 hustshawn

Thanks so much i was messing with this for way too long

Skylonatron avatar Nov 14 '17 06:11 Skylonatron