Home > Software design >  How to make 2 <Text> inline in React Native
How to make 2 <Text> inline in React Native

Time:12-01

I want to make 2 in one line, one flex-end and one flex-start, but I am not able to make it inline after applying flex-end and flex-start to the two separately. Anyone have idea how to do this?

<View style={{flexDirection: 'row'}}>
   <Text style={{alignSelf: 'flex-start'}}>Line 1</Text>
   <Text style={{alignSelf: 'flex-start'}}>Line 2</Text>
</View>

CodePudding user response:

Just use justifyContent:'space-between' and you are done, no need to use anything in Text

<View style={{flexDirection: 'row', justifyContent:'space-between'}}>
   <Text>Line 1</Text>
   <Text>Line 2</Text>
</View>
  • Related