I want to align text to the bottom right of a view. I have aligned the text to the right using
textAlign:'center'
Thanks
I want to align text to the bottom right of a view. I have aligned the text to the right using
textAlign:'center'
Thanks
Working Example: Expo Snack
Here is how you can align your Text
wherever you want with ease:
import * as React from 'react';
import { Text, View, StyleSheet } from 'react-native';
import Constants from 'expo-constants';
export default function App() {
return (
<View style={styles.container}>
<View style={styles.card}>
<View style={{ position: 'absolute', bottom: 10, right: 10 }}>
<Text>Bottom Right</Text>
</View>
<View style={{ position: 'absolute', bottom: 10, left: 10 }}>
<Text>Bottom Left</Text>
</View>
<View style={{ position: 'absolute', top: 10, right: 10 }}>
<Text>Top Right</Text>
</View>
<View style={{ position: 'absolute', top: 10, left: 10 }}>
<Text>Top Left</Text>
</View>
</View>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
paddingTop: Constants.statusBarHeight,
backgroundColor: '#ecf0f1',
padding: 8,
},
card: {
width: 200,
height: 200,
borderRadius: 10,
borderWidth: 5,
},
});