ReactNative: how to center text?

From headline‘ style remove heightjustifyContent 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',
  }

Leave a Comment