简体   繁体   English

包围反应本机矢量图标

[英]Encircle react-native-vector-icons

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/ 链接以响应本机矢量图标: https : //oblador.github.io/react-native-vector-icons/

在此处输入图片说明

Try to wrap it inside a View as a container 尝试将其包装在View作为容器

<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. 当然,可以根据自己的喜好更改宽度和高度。

Try adding the overflow:"hidden" option to your style 尝试在样式中添加“ overflow:"hidden"选项

<Icon  name={'ios-grid-outline'} style={{ 
  color: "rgb(170, 207, 202)", 
  borderRadius:10,
  borderWidth: 2,
  borderColor: 'rgb(170, 207, 202)',
  overflow: "hidden"
}} />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM