简体   繁体   English

"使用 lib 将 React Native 中的图标加粗:react-native-vector-icons"

[英]Bolding a icon from React Native using lib: react-native-vector-icons

How can i get a bold icon from react-native-vector-icon<\/code> or pass style props to component?如何从react-native-vector-icon<\/code>获取粗体图标或将样式道具传递给组件?

I tried to change font-weight css from browser dev tool and it's worked我试图从浏览器开发工具中更改字体粗细 css 并且它有效

"

You cannot adjust the thickness of the icon. 您无法调整图标的粗细。 But you can resize it. 但是您可以调整它的大小。

const myIcon = <Icon name="rocket" size={30} color="#900" />;

If you configure the icon button, you can change the thickness of the text. 如果配置图标按钮,则可以更改文本的粗细。

  <Icon.Button name="facebook" backgroundColor="#3b5998">
    <Text style={{ fontFamily: 'Arial', fontSize: 15 fontWeight:"bold" }}>
      Login with Facebook
    </Text>
  </Icon.Button>

您不能只使用 fontSize 样式道具来增加矢量图标的大小。

"

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

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