Nativebase: Size of icon at left and right of header is not similar?

Created on 13 Aug 2018  路  5Comments  路  Source: GeekyAnts/NativeBase

        <View>
          <Header style={headerContainerStyle}>
            <Left style={headerLeftStyle}>
              <Button transparent>
                <Icon name='ios-refresh' type='Ionicons' style={headerIconStyle} />
              </Button>
            </Left>
            <Body style={{ flexDirection: 'column' }}>
              <Title style={headerSmallText}>Jobs</Title>
              <Title style={headerSmallSubText}>Today, someStatus</Title>
            </Body>
            <Right style={headerLeftStyle}>
              <Button transparent>
                <Icon name='ios-refresh' type='Ionicons' style={headerIconStyle} />
              </Button>
            </Right>
          </Header>
          <View>
            <Text>JobsScreen Component</Text>
          </View>
        </View>

react-native, react and native-base version

"native-base": "^2.7.2",
"react": "16.4.1",
"react-native": "0.56.0",

Expected behaviour

Refresh button for left and right to be the same size

Actual behaviour

screen shot 2018-08-13 at 9 02 36 pm

Very obvious the icon on the left is much larger. They are sharing the exact same style, headerLeftStyle, which is only a marginLeft: 10

Is the bug present in both iOS and Android or in any one of them?

Both ios and android behave the same

Most helpful comment

I've also found that applying fontSize at Icon as below seems to be working consistently

<Icon name='ios-refresh' type='Ionicons' style={{ fontSize: 30 }} />

Wondering if this is the right way?

All 5 comments

I've also found that applying fontSize at Icon as below seems to be working consistently

<Icon name='ios-refresh' type='Ionicons' style={{ fontSize: 30 }} />

Wondering if this is the right way?

@isaaclem true. This is due to https://github.com/GeekyAnts/NativeBase/blob/master/src/theme/components/Header.js#L320
The condition values should be reversed

Fixed with 2.8.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sihemhssine picture sihemhssine  路  3Comments

natashache picture natashache  路  3Comments

georgemickael-b picture georgemickael-b  路  3Comments

eggybot picture eggybot  路  3Comments

Cotel picture Cotel  路  3Comments