headline: {
textAlign: 'center', // <-- the magic
fontWeight: 'bold',
fontSize: 18,
marginTop: 0,
width: 200,
backgroundColor: 'yellow',
}
const styles = StyleSheet.create({
//Container or View that wraps text
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center'
},
text: {
textAlign: "center",
},
// inside parent View component
justifyContent: "center",
<View style={{flex: 1, alignItems:'center', justifyContent:'center'}}>
<Text>This is a screen</Text>
</View>
textAlign: 'center'