Reputation: 622
I want to encircle react-native-vector icons. I have added a border radius in the style but it not helpful for all devices and also with every icon it behaves different.
<Icon name={'ios-grid-outline'} style={{ color: "rgb(170, 207, 202)",
borderRadius:10,
borderWidth: 2,
borderColor: 'rgb(170, 207, 202)',
}} />
Link to react native vector icons: https://oblador.github.io/react-native-vector-icons/
Upvotes: 4
Views: 10400
Reputation: 97
Try adding the overflow:"hidden"
option to your style
<Icon name={'ios-grid-outline'} style={{
color: "rgb(170, 207, 202)",
borderRadius:10,
borderWidth: 2,
borderColor: 'rgb(170, 207, 202)',
overflow: "hidden"
}} />
Upvotes: 8
Reputation: 324
Try to wrap it inside a View
as a container
<View
style={{
width: 10,
height: 10,
borderRadius: 5,
borderWidth: 2,
borderColor: 'rgb(170, 207, 202)'
}}>
<Icon name={'ios-grid-outline'} style={{...}} />
</View>
Change the width and height to your own preference of course.
Upvotes: 2