React-native-vector-icons: Vertically align Icon with text [QUESTION]

Created on 11 Aug 2016  路  5Comments  路  Source: oblador/react-native-vector-icons

What is the best way to vertically align a big Icon with text?

Most helpful comment

 <View style={{flexGrow: 1, justifyContent:'center' alignItems: 'center'}}>
   <Icon />
 </View>

@MrHubble Hope it helps!

All 5 comments

Yes, just use wrapper View and use flexbox to vertically align the children.

thank you very much!

@perrosnk are you able to give some sample code of how you achieved this? I'm struggling a little with flexbox at the moment. Thanks.

 <View style={{flexGrow: 1, justifyContent:'center' alignItems: 'center'}}>
   <Icon />
 </View>

@MrHubble Hope it helps!

Forgot a comma:

 <View style={{flexGrow: 1, justifyContent:'center', alignItems: 'center'}}>
   <Icon />
 </View>
Was this page helpful?
0 / 5 - 0 ratings

Related issues

venux92 picture venux92  路  3Comments

rmilejcz picture rmilejcz  路  3Comments

arjs1000 picture arjs1000  路  3Comments

peacechen picture peacechen  路  3Comments

mahdidavoodi7 picture mahdidavoodi7  路  3Comments