Skip to content

Can't seem to center align text #121

Description

@angarc

I've tried:

text: {
  textAlign: 'center'
}

but that doesn't work.

I've also tried adding the same styling to the View that surrounds the Markdown, but that doesn't work either.

When I try

paragraph: {
  textAlign: 'center'
}

that messes up everything! in fact, even if i just add

paragraph: {}

then all the text gets ruined and displays only one word per line for some reason.

How can I center align text?? Here are all the relevant bits:

renderDescription(description) {
  if (description === '' || description === null) return 

  return (<Markdown styles={styles.resource.description}>{description}</Markdown>)
}



<View key={resource.id} style={styles.resource.container}>
  { this.renderDescription(resource.description) }
</View>



const styles = {
  resource: {
    container: {
      marginTop: 20,
      marginBottom: 20,
    },
    description: {
      view: {
        marginTop: 10
      },
      text: {
        fontFamily: 'Gotham-Book',
        textAlign: 'center', // Doesn't work
      },
    },
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions