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.

Flex styling is messed up.

See original GitHub issue

simulator screen shot 09-feb-2017 12 46 25 am

Here is my code.

render() {
    return (
      <View style={{flex:1,backgroundColor:'black'}}>
      <KeyboardAwareScrollView viewIsInsideTabBar={false}>
        <View style={{backgroundColor:'white', flex:1}}>
          <TouchableOpacity onPress={this.props.onClosePanel}>
            <Text>{'This is my drawer'}</Text>
          </TouchableOpacity>
        </View>
        {this.renderWriteMessage()}
      </KeyboardAwareScrollView>
      </View>
    );
  }

I have given the top box flex 1. Then in that view I have created another view with flex value one. What it should do is extend that subview to bottom and the textinput should be at bottom.

If i remove KeyboardAwareScrollView element from the code it renders this.

simulator screen shot 09-feb-2017 12 50 04 am

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7

github_iconTop GitHub Comments

105reactions
ShayanJavadicommented, Jan 27, 2018

If anyone is still having this issue try adding {flexGrow: 1} to the contentContainerStyle prop like so:

<KeyboardAwareScrollView
  contentContainerStyle={{flexGrow: 1}}
>
   // children go here
</KeyboardAwareScrollView>
26reactions
davidvpecommented, Feb 19, 2018

▲ This should be on the doc really…

Read more comments on GitHub >

github_iconTop Results From Across the Web

display:flex not working in Chrome - Stack Overflow
This messed up with the flex for some reason, so I ended up setting box-sizing to content-box on most elements again and this...
Read more >
A Complete Guide to Flexbox | CSS-Tricks
Our comprehensive guide to CSS flexbox layout. This complete guide explains everything about flexbox, focusing on all the different possible ...
Read more >
How to Fix Overflow Issues in CSS Flex Layouts - Modus Create
I recently ran into an odd overflow problem in Firefox, Safari and Edge. I had a simple flex column layout that needed to...
Read more >
Basic concepts of flexbox - CSS: Cascading Style Sheets | MDN
When we describe flexbox as being one dimensional we are describing the fact that flexbox deals with layout in one dimension at a...
Read more >
The thing people get wrong about flex-basis - YouTube
Dive even deeper with my 4-hour long flexbox course: https://flexboxsimplified.comFlex-basis is one of those things that people sort of, ...
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