How to set a style attribute to fill the space for relaxation?

As you see the image, if three parent views are already added in the parent view. Now I want to add another blue view that can fill the space for relaxation. How to set the style?

enter image description here

+4
source share
1 answer

You can try this:

<View style={{flex:1,backgroundColor:'white'}}>
  <View style={{justifyContent:'space-around'}}>
    <View style={{height:50,alignSelf:'stretch',backgroundColor:'pink',margin:5}}/>  
    <View style={{height:50,alignSelf:'stretch',backgroundColor:'pink',marginHorizontal:5}}/>  
    <View style={{height:50,alignSelf:'stretch',backgroundColor:'pink',margin:5}}/>  
  </View>
  <View style={{flex:1,alignItems:'center',justifyContent:'center',alignSelf:'stretch',backgroundColor:'blue',margin:5}}>
    <Text style={{color:'white',fontWeight:'bold'}}>
      View
    </Text>
  </View>
</View>

enter image description here

+3
source

Source: https://habr.com/ru/post/1659685/


All Articles