在React Native Elements中,有一个指向图标目录的链接。第一个库是AntDesign:截图
在类型中,他们说“类型(默认为material,选项为material-community、zocial、font-awesome、octicon、ionicon、foundation、evilicon、simple-line-icon、feather或entypo)”。这些中没有包括AntD。我尝试过type="ant-d"
、type="antd"
、type="ant-design"
和type="antdesign"
。由于这似乎非常简单,我希望浪费尽可能少的时间。我错过了什么吗?
这是我的代码片段,我已经添加了type
:
render() {
const { selectedIndex } = this.state
const buttons = [
{ element: () => <Icon name="notification" type="ant-design" color={ selectedIndex === 0 ? colorsAndFonts.colors.redBalehu : colorsAndFonts.colors.warmGrey } /> },
{ element: () => <Icon name="credit-card" color={ selectedIndex === 1 ? colorsAndFonts.colors.redBalehu : colorsAndFonts.colors.warmGrey } /> },
{ element: () => <Icon name="account-circle" color={ selectedIndex === 2 ? colorsAndFonts.colors.redBalehu : colorsAndFonts.colors.warmGrey } /> },
{ element: () => <Icon name="camera-alt" onPress={ this.takePhoto } color={ selectedIndex === 3 ? colorsAndFonts.colors.redBalehu : colorsAndFonts.colors.warmGrey } /> },
{ element: () => <Icon name="help-outline" color={ selectedIndex === 4 ? colorsAndFonts.colors.redBalehu : colorsAndFonts.colors.warmGrey } /> },
]
当然,我收到的是一个问号而不是图标。
提前感谢!