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.

button auto full width

See original GitHub issue

expect fromweb

but the view in android vm like fromandroid

code

import React, { Component } from 'react';
import { Container, Header, Content, Button, Text } from 'native-base';
export default class ButtonThemeExample extends Component {
  render() {
    return (
      <Container>
        <Header />
        <Content>
          <Button light><Text> Light </Text></Button>
          <Button primary><Text> Primary </Text></Button>
          <Button success><Text> Success </Text></Button>
          <Button info><Text> Info </Text></Button>
          <Button warning><Text> Warning </Text></Button>
          <Button danger><Text> Danger </Text></Button>
          <Button dark><Text> Dark </Text></Button>
        </Content>
      </Container>
    );
  }
}

i try full={false} but still not work

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

21reactions
matecservencommented, Nov 20, 2019

This should be mentioned in the docs, it is quite misleading.

13reactions
ahmadsyamimcommented, Jan 24, 2020
<Content>
<View style={{
flex:0
}}>

should be fine i think.

import React, { Component } from 'react';
import { Container, Header, Content, View, Button, Text } from 'native-base';
export default class ButtonThemeExample extends Component {
  render() {
    return (
      <Container>
        <Header />
        <Content>
            <View style={{flex:0}}>
                <Button light><Text> Light </Text></Button>
                <Button primary><Text> Primary </Text></Button>
                <Button success><Text> Success </Text></Button>
                <Button info><Text> Info </Text></Button>
                <Button warning><Text> Warning </Text></Button>
                <Button danger><Text> Danger </Text></Button>
                <Button dark><Text> Dark </Text></Button>
            </View>
        </Content>
      </Container>
    );
  }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Prevent button from taking up the full width of its container
Try using width: auto; const SmallButton = styled(StyledButton)` display: inline-flex; flex-grow: 0; font-size: 15px; font-weight: 500; ...
Read more >
How To Create Full Width Buttons - W3Schools
Learn how to style block buttons (full-width) with CSS. ... To create a full-width button, add a width of 100% and make it...
Read more >
From full-width to auto-width buttons using flex-direction
Normally, on smaller screens, we want our buttons to occupy the whole width and shrink to their "auto" size on bigger screens.
Read more >
Creating Full Width Button in Flutter - The Right Way in 2022
In this tutorial, we'll learn how to create a full width button in Flutter with a practical example using the EelevatedButton in Flutter....
Read more >
CSS Nugget: Full-Width to Auto-Width Buttons in Flexbox
Receive a monthly CSS nugget by email: https://codyhouse.co/newsletter Code demo: ...
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