反应本机按钮图标不显示
React Native Button Icon not showing
我正在使用 expo 的 snack,没有正确显示图标,我做错了什么?
我测试了这个零食 https://callstack.github.io/react-native-paper/button.html 和许多其他零食,但它总是显示矩形图标。
我正在使用世博会 36.0.0
该问题在 expo 日志中显示为
Tried to use the icon 'stepforward' in a component from 'react-native-paper', but 'react-native-vector-icons' could not be loaded.
To remove this warning, try installing 'react-native-vector-icons' or use another method to specify icon: https://callstack.github.io/react-native-paper/icons.html.
Even if you try to add package it's still not resolved by this, some issue in expo as reported here Expo forums
以下是 Snack link
的解决方法
- 使用 Expo 矢量图标
import { Ionicons } from '@expo/vector-icons';
2.Get 输入
import SimpleIcon from 'react-native-vector-icons/SimpleLineIcons';
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
然后作为 child
我正在使用 expo 的 snack,没有正确显示图标,我做错了什么? 我测试了这个零食 https://callstack.github.io/react-native-paper/button.html 和许多其他零食,但它总是显示矩形图标。
该问题在 expo 日志中显示为
Tried to use the icon 'stepforward' in a component from 'react-native-paper', but 'react-native-vector-icons' could not be loaded. To remove this warning, try installing 'react-native-vector-icons' or use another method to specify icon: https://callstack.github.io/react-native-paper/icons.html. Even if you try to add package it's still not resolved by this, some issue in expo as reported here Expo forums
以下是 Snack link
的解决方法- 使用 Expo 矢量图标
import { Ionicons } from '@expo/vector-icons';
2.Get 输入
import SimpleIcon from 'react-native-vector-icons/SimpleLineIcons';
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
然后作为 child