Skip to main content

From headline' style remove height, justifyContent and alignItems. It will center the text vertically. Add textAlign: 'center' and it will center the text horizontally.

 headline: { textAlign: 'center', // <-- the magic fontWeight: 'bold', fontSize: 18, marginTop: 0, width: 200, backgroundColor: 'yellow', } 
 headline: { textAlign: 'center', // <-- the magic fontWeight: 'bold', fontSize: 18, marginTop: 0, width: 200, backgroundColor: 'yellow', } 

From headline' style remove height, justifyContent and alignItems. It will center the text vertically. Add textAlign: 'center' and it will center the text horizontally.

 headline: { textAlign: 'center', // <-- the magic fontWeight: 'bold', fontSize: 18, marginTop: 0, width: 200, backgroundColor: 'yellow', } 

From headline' style remove height, justifyContent and alignItems. It will center the text vertically. Add textAlign: 'center' and it will center the text horizontally.

 headline: { textAlign: 'center', // <-- the magic fontWeight: 'bold', fontSize: 18, marginTop: 0, width: 200, backgroundColor: 'yellow', } 
deleted 6 characters in body
Source Link
Ivan Chernykh
  • 42.2k
  • 13
  • 136
  • 148

From headline' style remove height, justifyContent and alignItems. It will center the text vertically. Add textAlign: 'center' to it and it will center the text horizontally.

 headline: { textAlign: 'center', // <-- the magic fontWeight: 'bold', fontSize: 18, marginTop: 0, width: 200, backgroundColor: 'yellow', } 

From headline' style remove height, justifyContent and alignItems. It will center the text vertically. Add textAlign: 'center' to it and it will center the text horizontally.

 headline: { textAlign: 'center', // <-- the magic fontWeight: 'bold', fontSize: 18, marginTop: 0, width: 200, backgroundColor: 'yellow', } 

From headline' style remove height, justifyContent and alignItems. It will center the text vertically. Add textAlign: 'center' and it will center the text horizontally.

 headline: { textAlign: 'center', // <-- the magic fontWeight: 'bold', fontSize: 18, marginTop: 0, width: 200, backgroundColor: 'yellow', } 
added 3 characters in body
Source Link
Ivan Chernykh
  • 42.2k
  • 13
  • 136
  • 148

From headline' style remove height, justifyContent and alignItems. It will center the text vertically. Add textAlign: 'center' to it and it will center the text horizontally.

 headline: { fontWeighttextAlign: 'bold''center', // <-- the magic fontSizefontWeight: 18'bold', marginTopfontSize: 018, widthmarginTop: 2000, textAlignwidth: 'center'200, backgroundColor: 'yellow', } 

From headline' style remove height, justifyContent and alignItems. It will center the text vertically. Add textAlign: 'center' to it and it will center the text horizontally.

 headline: { fontWeight: 'bold', fontSize: 18, marginTop: 0, width: 200, textAlign: 'center', backgroundColor: 'yellow', } 

From headline' style remove height, justifyContent and alignItems. It will center the text vertically. Add textAlign: 'center' to it and it will center the text horizontally.

 headline: { textAlign: 'center', // <-- the magic fontWeight: 'bold', fontSize: 18, marginTop: 0, width: 200, backgroundColor: 'yellow', } 
Source Link
Ivan Chernykh
  • 42.2k
  • 13
  • 136
  • 148
Loading