Icons not showing in React Native + React Native Paper app

江枫思渺然 提交于 2021-01-27 05:40:48

问题


This is a fresh React Native app using React Native Paper. I followed the instructions at https://callstack.github.io/react-native-paper/getting-started.html and installed react-native-paper and react-native-vector-icons.

For some reason, none of the icons are showing in the app -- see below:

For example, I have a Searchbar at the top of this screen with the following code. As far as I can see, I don't even have to specify an icon there. It should automatically display a magnifying glass but no icon is showing.

<Searchbar placeholder="New to do item..." />

Any idea why and how to fix it?


回答1:


Stop your application. Then go to project directory > open cmd > run npx react-native link react-native-vector-icons

cmd will show you linking is successful

Now run your app again



来源:https://stackoverflow.com/questions/61780481/icons-not-showing-in-react-native-react-native-paper-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!