I need to achieve this:
https://jsfiddle.net/ghxfpL7j/1/
In React Native but:
- You can't have a View inside a Text
- You can't set a margin or padding for a Text
I tried having the "C" inside a View and the text and then another view for the other Text with the number but I couldn't achieve the same because when the name is too long it does not work.
This is what I tried:
<View style={a}>
<View style={b}><Text style={c}>C</Text></View>
<Text style={d}>Player name</Text>
<View style={e}>20</View>
</View>
and then styles:
a: {
flexDirection: 'row',
flexWrap: 'wrap'
}
b:{
width: 20,
backgroundColor: '#000'
}
c:{
color: '#ddd
}
d:{
flex: 1,
text-align: 'right'
}
e:{
text-align: 'right'
}