Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't seem to center align text #121

Open
angarc opened this issue Aug 25, 2020 · 1 comment
Open

Can't seem to center align text #121

angarc opened this issue Aug 25, 2020 · 1 comment

Comments

@angarc
Copy link

angarc commented Aug 25, 2020

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
      },
    },
  }
}

@raphael-ms
Copy link

Any updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants