"native-base": "^0.5.19",
"react": "~15.4.0-rc.4",
"react-native": "0.38.0",
I want to divide
<View style={{flex: 1}}>
<View style={{ flex:1, backgroundColor: 'yellow' }}>
<Text>window 1</Text>
</View>
<View style={{ flex:1, backgroundColor: 'green' }}>
<Text>window 2</Text>
</View>
</View>
this works as expected. But I want to use <Container> and <Content> elements for this component. I am trying the following:
<Container><Content>
<View style={{ flex:1, backgroundColor: 'yellow' }}>
<Text>window 1</Text>
</View>
<View style={{ flex:1, backgroundColor: 'green' }}>
<Text>window 2</Text>
</View>
</Content></Container>
With <Container> and <Content> elements, using flex: 1 has no impact. The upper view with yellow background is just shown as one liner encapsulating the <Text> element.
<Container><Content>
<View style={{ flex:1, backgroundColor: 'yellow' }}>
<Text>window 1</Text>
</View>
<View style={{ flex:1, backgroundColor: 'green' }}>
<Text>window 2</Text>
</View>
</Content></Container>
any of them.
fixed it by doing:
```
when I use flex in contentContainerStyle I keep getting an error saying 'you attempted to set the key padding with the value 0 on an object that is meant to be immutable and hes been frozen.
This triggers for ex when I push a route or pressing a Fab button, but only when setting flex: 1 on Content, did you encounter this issue?
I didn't get any such error.
I'm also seeing this issue. @eduedix workaround worked for me. Why the need for the workaround though?
The same problem happens to Tabs and Tab.
Following code does the work.
<Container>
<Headers></Headers>
<Tabs contentContainerStyle={{ flex: 1 }}>
<Tab style={{flex: 1}}>
<View style={{ flex:1, backgroundColor: 'yellow' }}>
<Text>window 1</Text>
</View>
</Tab>
</Tabs>
</Container>
@keslert That's because Content is wrapped around ScrollView and we need to add styles to contentContainerStyle for that.
This should be mentioned in the doc.
I fixed by giving
Most helpful comment
fixed it by doing:
```