Nativebase: Header. How to show a long Title?

Created on 24 Feb 2017  路  8Comments  路  Source: GeekyAnts/NativeBase

In the Native Base documentation we can see the following image:

We see that <Title> can use more space but it is cut off.
How to show a long <Title>?

Most helpful comment

For anyone coming from Google, as mentioned in #605 <Body style={{flex: 3}}> fixes this issue for me.

All 8 comments

Same question. Any configuration for that? or I have to restyle the Header component?

You'll have to eject and change the header component. Just set the flex value here to higher value. Please feel free to ask if you have any problems with ejecting.

For anyone coming from Google, as mentioned in #605 <Body style={{flex: 3}}> fixes this issue for me.

@klvs your solution works but then the title is no longer centered. Is there a way to easily center it after applying flex: 3 on the styles?

Just wrap it to <Text></Text>
Dont use <Title></Title>

Setting flex: 1 for <Body> and flex: 0 for <Left> and <Right> also seems to do the trick and you'll get a <Body> that takes up all remaining width. You might have to play around with margins/paddings, though, to get the desired look.

@cdimitroulas This should centralize the title...

<Body style={{flex: 3, flexDirection:'row', justifyContent:'center'}}>

xDirection:'row'

Or { flex: 3, alignItems: "center" }

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chetnadaffodil picture chetnadaffodil  路  3Comments

muthuraman007 picture muthuraman007  路  3Comments

sihemhssine picture sihemhssine  路  3Comments

agersoncgps picture agersoncgps  路  3Comments

natashache picture natashache  路  3Comments