After some digging, I found there're two easy ways to achieve this:
// first way
<View style={{flexDirection: "row", justifyContent: "space-between"}}>
<Button>B1</Button> // align left
<Button>B2</Button> // align right
</View>
// second way
<View style={{flexDirection: "row"}}>
<Button>B1</Button> // align left
<Button style={{marginLeft: "auto"}}>B2</Button> // align right
</View>
2
Answers
After some digging, I found there're two easy ways to achieve this:
to do this, use
space-between
. If the container has awidth
larger than the 2 buttons, you’ll see one on the left, one on the rightdoc