question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Content does not stretch to full height

See original GitHub issue

react-native, react and native-base version

"react-native": "0.48.4"
"react": "16.0.0-alpha.12"
"native-base": "2.3.3"

Expected behaviour

Flatlist (horizonatl) present inside the content must stretch to full height.

Actual behaviour

Flatlist wraps the height, without content it used to fill the whole height.

Steps to reproduce (code snippet or screenshot)

<Container style={{ marginTop: 22 }}>
        <Header searchBar rounded>
          <Item>
            <Icon active name='search' />
            <Input placeholder='Search' />
          </Item>
          <Button transparent>
            <Text>Search</Text>
          </Button>
        </Header>
        <Content style={{ flex: 1 }}>
          <FlatList
            data={this.state.items}
            renderItem={this.renderRow.bind(this)}
            keyExtractor={(item) => item.row._id}
            horizontal
            removeClippedSubviews={false}
            style={{ flex: 1 }}
          />
        </Content>
</Container>

Screenshot of emulator/device

simulator screen shot - iphone 6 - 2017-10-31 at 16 23 37

Is the bug present in both ios and android or in any one of them?

Issue seen in Both

Any other additional info which would help us debug the issue quicker.

I tried,

  • wrapping up Flatlist with nativebase View
  • Giving style={{ flex: 1 }} contentContainerStyle={{ flex: 1 }} to Content.
  • Tried giving flex to the items which are being displayed. None of them is working.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

164reactions
gokulkulkarni1987commented, Oct 31, 2017

fixed it by adding, contentContainerStyle={{ flexGrow: 1 }}

9reactions
shah-vivekcommented, Aug 8, 2018

@SupriyaKalghatgi The property “contentContainerStyle” is not present on the documentation. Is there a plan to deprecate this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Full height div not stretching - html - Stack Overflow
I have just noticed that, on smaller screens, the height of the white background does not stretch past all of the content. Setting...
Read more >
height - CSS: Cascading Style Sheets - MDN Web Docs
The height CSS property specifies the height of an element. By default, the property defines the height of the content area.
Read more >
Why is height not working?. Parent does not stretch to child's…
If content is fluid, maximum width will reach window width. ... If the content is fluid, height will stretch indefinitely to fit it....
Read more >
CSS Height Full Page: CSS gotcha: How to fill page with a div?
What?! It doesn't work! The height still only takes up the content, but not the whole page. The width is good since a...
Read more >
CSS- Div- Be Careful When You Size Your Divs
Place both DIVs into a container DIV that's set to 100% of page height and set both interior DIVS to 100%. They will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found