question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

how make text center instead left align

See original GitHub issue
screen shot 2016-03-02 at 10 50 23 am

I want to make “Login Facebook” text center align instead left, just only text not icon

<Icon.Button name="facebook" size={24} backgroundColor="#3b5998" height={40} onPress={this.loginWithFacebook}>
<Text style={{fontFamily: 'Arial', fontSize: 15, color: '#FFF', textAlign:'center'}}>Login Facebook</Text>
</Icon.Button>

textAlign not work, what I missed ?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

9reactions
dzptcommented, Jun 20, 2017

@oblador how do i center the icon too?

2reactions
obladorcommented, Mar 2, 2016

Try adding flex: 1 to your Text style.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS: Center block, but align contents to the left - Stack Overflow
First, create a parent div that centers its child content with text-align: center . Next, create a child div that uses display: inline-block...
Read more >
How to Center Text & Headers in CSS Using the Text-Align ...
To center text in CSS, use the text-align property and define it with the value 'center.' You can use this technique inside block...
Read more >
Alignment, font styles, and horizontal rules in HTML documents
This attribute specifies the horizontal alignment of its element with respect to the surrounding context. Possible values: left : text lines are rendered ......
Read more >
Text Align in CSS – How to Align Text in Center with HTML
If you wanted to horizontally center all of the text on the page, then you can use the text-align property in the body...
Read more >
text-align - CSS: Cascading Style Sheets - MDN Web Docs
The text-align CSS property sets the horizontal alignment of the inline-level content inside a block element or table-cell box.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found