larsvinter / react-native-awesome-button

A button React Native component supporting showing different states with animations
MIT License
235 stars 47 forks source link

Is it possible to add an icon, like FontAwesome, to text? #3

Closed nbastoWM closed 7 years ago

nbastoWM commented 9 years ago

I guess the title says it all.

Coolnesss commented 7 years ago

+1

I managed to do something like

text: <Text><Icon style={styles.icon} name="camera"/> See the camera photo</Text>,

Using react-native-material-design, but the icons are aligned incorrectly and look ugly. I couldn't fix the alignment for some reason, any ideas?

larsvinter commented 7 years ago

Hi guys.

Just implemented this in 1.8.2 (in fact you can now pass in any sub-view, so not just an icon). You can pass in styling props to the backgroundStyle to make sure it is nicely centered etc (see the updated Advanced example for how to have a user icon next to a "login" label).

Enjoy...