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.

Cannot Center Button with NativeBase

See original GitHub issue

Hi, I am trying to center a button on the screen, but cannot do so. Here is my code: <Container> <Content> <Card> <CardItem> <Body> <Button>Text</Button> </Body> <CardItem> </Card> <Content> </Container> I have tried using justify content, alignItems and a bunch of other things, but am not able to center the button with “Text”. Any help? currently, it is just on the left of the screen. I am using android.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

38reactions
SupriyaKalghatgicommented, Nov 27, 2017

@zmerchant17 flexDirection: "row", justifyContent: "center" with <Body> should do the work

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot Center Buttons horizontally with NativeBase
Trying to center buttons horizontally with Native Base. Any idea why the following do not work? <Container style={{ backgroundColor: '#fff', ...
Read more >
Button - NativeBase
Button : The button component with support for custom icons, spinners, etc. Button.Group : Used to group buttons whose actions are related, with...
Read more >
Cannot Center Buttons horizontally with NativeBase-React ...
Coding example for the question Cannot Center Buttons horizontally with NativeBase-React Native.
Read more >
Button - React Native
A basic button component that should render nicely on any platform. ... me" disabled onPress={() => Alert.alert('Cannot press this one')} ...
Read more >
Vertically and Horizontally Center Text in React Native
So the fix is to wrap our Text component in a view that does understand vertical orientation. That view will get justifyContent: 'center'....
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