React-native-vector-icons: Can you add badges to icons?

Created on 9 Sep 2016  路  4Comments  路  Source: oblador/react-native-vector-icons

Is there documentation re: this anywhere? Thanks in advance.

Most helpful comment

<View style={styles.badgeIconView}>
        <Text style={styles.badge}> 2 </Text>
        <Image source={require('./images/icon.png')} style={{width:30,height:30}} />
</View>

and style below:

badgeIconView:{
    position:'relative',
    padding:5
  },
  badge:{
    color:'#fff',
    position:'absolute',
    zIndex:10,
    top:1,
    right:1,
    padding:1,
    backgroundColor:'red',
    borderRadius:5
  }

All 4 comments

Thx @sibelius, yeah look elsewhere for badges or simply make it yourself with borderRadius :-)

<View style={styles.badgeIconView}>
        <Text style={styles.badge}> 2 </Text>
        <Image source={require('./images/icon.png')} style={{width:30,height:30}} />
</View>

and style below:

badgeIconView:{
    position:'relative',
    padding:5
  },
  badge:{
    color:'#fff',
    position:'absolute',
    zIndex:10,
    top:1,
    right:1,
    padding:1,
    backgroundColor:'red',
    borderRadius:5
  }
Was this page helpful?
0 / 5 - 0 ratings

Related issues

jakewtaylor picture jakewtaylor  路  4Comments

obykoo picture obykoo  路  3Comments

emretekince picture emretekince  路  4Comments

lossen picture lossen  路  4Comments

a82448186 picture a82448186  路  4Comments