NativeBase icon indicating copy to clipboard operation
NativeBase copied to clipboard

Big space between <Left> and <Body> in Header component (NativeBase ^2.1.3)

Open gustavorozolin opened this issue 9 years ago • 4 comments

I have used this code: <Header> <Left> <Button transparent onPress={() => this.voltar()}> <Icon name="arrow-back"/> </Button> </Left> <Body> <Title>Title</Title> </Body> </Header>

Result: screenshot_2017-04-27-16-07-14

gustavorozolin avatar Apr 27 '17 19:04 gustavorozolin

You also need to include <Right /> inside the Header <Header> <Left> <Button transparent onPress={() => this.voltar()}> <Icon name="arrow-back"/> </Button> </Left> <Body> <Title>Title</Title> </Body><Right /></Header>

shivrajkumar avatar Apr 28 '17 05:04 shivrajkumar

Thanks for reply @shivrajkumar,

I've made 3 new tests and I got this result: screenshot_2017-04-28-14-24-43 screenshot_2017-04-28-14-24-32 screenshot_2017-04-28-14-23-34

gustavorozolin avatar Apr 28 '17 17:04 gustavorozolin

@shivrajkumar and so NativeBase Header doesn't follow Material UI guidelines, yep? https://material.io/guidelines/layout/structure.html#structure-app-bar It will be all the same if you write Header correctly with Left, Body and Right components. Title will be far from Left icon. Or maybe Left component is very beside to the left border

RakhmatovR avatar May 23 '17 09:05 RakhmatovR

Sorry for necro-posting this issue, but it is the first one on google. You can fix that property applying flex items properties, to the <Left> <Body> and <Right> like flex, flex-grow, flex-shrink etc.

samuelhnrq avatar Jan 10 '18 00:01 samuelhnrq