react native text align
React Native can make it difficult to align a component correctly.
text-align:right
. You can useflexbox
to right-align an element on a View Component.
Use flexDirection: 'row'
and justifyContent: 'flex-end'
on the View
export default () => { return ( <View style={{ flexDirection: "row", justifyContent: "flex-end" }} > <Button title="Tap Me" onPress={() => console.log("Congrats You Clicked !")} /> </View> ) }
Use alignItems: 'flex-end'
on the View
export default () => { return ( <View style={{ alignItems : "flex-end" }} > <Button title="Tap Me" onPress={() => console.log("Congrats You Clicked !")} /> </View> ) }