Reputation: 304
So I'm trying to add View Boxes next to each other. So first I made a box as shown
And then I made multiple as shown
So my question is how to put the boxes next to each other?
Here is my React Native Css
readings:{
width:100,
height:100,
backgroundColor:'#e3e3e3',
marginLeft:20,
shadowColor: '#000',
shadowOffset: { width: 4, height: 4 },
shadowOpacity: 0.8,
shadowRadius: 2,
elevation:5,
float:'right'
}
Upvotes: 0
Views: 691
Reputation: 871
You should use flex to achieve that. Something like
<View style={{
display: 'flex',
flexDirection: 'row'
}}>
<View style={{width: 100, height: 100, backgroundColor: 'red'}}></View>
<View style={{width: 100, height: 100, backgroundColor: 'blue'}}></View>
</View>
Where you have one top View that orders the items in row.
Upvotes: 2