I can give the height element of style numeric values such as 40
but these are required to be integers. How can I make my component to have a height of 100%>
flex:1
should work for almost any case. However, remember that for ScrollView
, it's contentContainerStyle
that controls the height of view:
WRONG
const styles = StyleSheet.create({
outer: {
flex: 1,
},
inner: {
flex: 1
}
});
CORRECT
const styles = StyleSheet.create({
outer: {
flex: 1,
},
inner: {
flex: 1
}
});