Nativebase: Weird issue about button with icon right

Created on 29 Nov 2017  路  3Comments  路  Source: GeekyAnts/NativeBase

native-base: 2.3.3
react-native: 0.50.4

If there's 1 button, it works normal. But if there're 2 buttons with 1 iconLeft and 1 iconRight, then the UI break
screen shot 2017-11-29 at 9 23 41 pm
Here is my code:

class Home extends Component {
  render() {
    return (
      <View style={styles.container}>
        <Button iconLeft success>
          <Icon name='arrow-back' />
          <Text>Back</Text>
        </Button>

        <Button iconRight success style={{marginLeft: 10}}>
          <Text>Next</Text>
          <Icon name='arrow-forward' />
        </Button>
      </View>
    )
  }
}

Most helpful comment

@maphongba008 just simply wrap all your components in <Container/>. Read about NativeBase screen structure here

Gif

iconright01

All 3 comments

@maphongba008 just simply wrap all your components in <Container/>. Read about NativeBase screen structure here

Gif

iconright01

@akhil-geekyants thanks mate, didn't know that I must follow NativeBase structure

@maphongba008 Yes, thats mentioned in the Docs at very beginning section of Components

Was this page helpful?
0 / 5 - 0 ratings

Related issues

omerdn1 picture omerdn1  路  3Comments

mcpracht picture mcpracht  路  3Comments

muthuraman007 picture muthuraman007  路  3Comments

sihemhssine picture sihemhssine  路  3Comments

Cotel picture Cotel  路  3Comments