Skip to content

[ListView] wrapped by NavigatorIOS contentInsets inconsistency -- somehow linked to translucency of the titlebar  #2151

Closed

Description

@jaygarcia

At first I thought my implementation of List View was wonky, but then I started to realize that no, there's a bug.

I've created a repo for this issue that's easy to recreate: https://github.com/ModusCreateOrg/react-native-navigator-ios-bugs

The crux of the problem is that after a layout reflow, ListView has a problem repositioning the top of the content, which it somehow calculates further to the top than originally displaying.

Demos:
UIExplorer version:
uiexplorer

Github project above version:

demo1

demo2

Activity

  1. shlomiatar commented on Jul 29, 2015

    @shlomiatar
    Contributor

    Hmm.
    Maybe you should try to set the automaticallyAdjustContentInsets prop on your ListView to false?
    We had a few issues with lists padding and turning it off helped:

    <ListView  automaticallyAdjustContentInsets={false} />
  2. jaygarcia commented on Jul 29, 2015

    @jaygarcia
    ContributorAuthor

    @schlomiatar, I will give that a go. I still think it's a bug since it doesn't work properly. :(

  3. jaygarcia commented on Jul 30, 2015

    @jaygarcia
    ContributorAuthor

    @shlomiatar , no dice. It actually makes things really bad.
    breaking

  4. changed the title [-][ListView] positioning issue after layout changes[/-] [+][ListView] positioning issue after layout changes (contentInsets related?)[/+] on Jul 30, 2015
  5. jaygarcia commented on Jul 30, 2015

    @jaygarcia
    ContributorAuthor

    Another weirdness: Changing translucent : false from default true fixes this issue!

    pulldown

  6. changed the title [-][ListView] positioning issue after layout changes (contentInsets related?)[/-] [+][ListView] contentInsets inconsistency -- somehow linked to translucency of the titlebar [/+] on Jul 30, 2015
  7. jaygarcia commented on Jul 31, 2015

    @jaygarcia
    ContributorAuthor

    So it seems that translucent : false prevents you from scrolling to the bottom. D:

    pulldown

  8. jaygarcia commented on Aug 5, 2015

    @jaygarcia
    ContributorAuthor

    Turns out that this is some type of layout bug with Navigator IOS and child items.

    In an iPhone 6, the only way to resolve some of these issues is with fudging things around.

    1. Turn off translucent as detailed above.
    2. wrap the ListView with another view, whose height is window.height - 60px
                <View style={{height: window.height - 60, backgroundColor : '#0000FF'}}>
                    <ListView 
                        style={styles.listView} 
                        dataSource={this.state.dataSource} 
                        initialListSize={30} 
                        pageSize={30} 
                        scrollRenderAheadDistance={50} 
                        renderRow={this._renderRow}
                    />
                </View>
    

    The demo below is an example of how this is resolved with wrapping the list view.

    pulldown

  9. changed the title [-][ListView] contentInsets inconsistency -- somehow linked to translucency of the titlebar [/-] [+][ListView] wrapped by NavigatorIOS contentInsets inconsistency -- somehow linked to translucency of the titlebar [/+] on Aug 5, 2015
  10. alvaromb commented on Sep 7, 2015

    @alvaromb
    Contributor

    Sorry for the off-topic @jaygarcia, but how do you managed to use NavigatorIOS inside a modal component?

  11. christopherdro commented on Sep 13, 2015

    @christopherdro
    Contributor

    I think it's important to note the difference of behavior when using ListView with NavigatorIOS specifically.

    Here's a sample from 0.11.0-rc that shows you don't need to make any adjustments to the ListView to get the content to line up properly, with either translucent set to true or false. https://rnplay.org/apps/WF7zAg

    For others who are having similar issues but are NOT using NavigatorIOS then your going to have add automaticallyAdjustContentInsets={false} to your ListView. See #1779

    @alvaromb You could check out the UIExplorer demo included on the repo. I think this should help.

    @ide @brentvatne

  12. jaygarcia commented on Sep 17, 2015

    @jaygarcia
    ContributorAuthor

    @christopherdro , thanks. I'll look to upgrade RN versions soon. I do so very cautiously because things keep changing causing breaks in my app :)

  13. jaygarcia commented on Oct 20, 2015

    @jaygarcia
    ContributorAuthor

    Closing this.

  14. locked as resolved and limited conversation to collaborators on Jul 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions