javascript - 反应原生:有办法显示 Ionicon 吗?
问题描述
我尝试显示图标,但它给了我一个错误:警告:道具类型失败:提供给name
的价值道具无效ios-arrow-down-circle
Icon
renderHeader = section => {
let index = this.state.activeSections[0];
let currentObj = this.state.section[index];
console.log('state', section);
return (
<View style={styles.header}>
<Text style={{fontWeight:'bold',fontSize: 20}}>{section.tableHeadAccordion}</Text>
<Ionicon
size={25}
color={"black"}
name={
currentObj == section
? "ios-arrow-forward-circle"
: "ios-arrow-down-circle"
}
/>
</View>
);
};
解决方案
包中的图标名称不同,尤其是在 react-native-vector-icons 中。
试试这些名字“ ios-arrow-dropdown
”和“ ios-arrow-dropright
”。
推荐阅读
- tensorflow-serving - CPU AVX AVX2 的 TensorFlow Serving 编译失败
- python - 用字符串列表中的相应值替换字符串
- firebase - google 登录后无法获取 Google auth 标头(空值检查运算符用于空值)
- django - 如何用芹菜运行爬虫
- database - 如何使用部分值存储 TIMESTAMPTZ
- latex - 有什么方法可以自动将句点移动到引号内?(csquotes 似乎不起作用)
- python - 不同的 URL 格式使用 Python 的 requests.get 从相同的 API 返回不同的数据类型
- chrome-web-store - 查看发布到 Chrome 网上应用店的以前版本的扩展程序?
- python - 无法用python为这个程序编写脚本,有人可以推荐任何让它工作的东西吗
- twilio - Twilio SMS statusCallbackUrl 不允许使用 405 方法