图标未显示在 React Native + React Native Paper 应用程序中 [英] Icons not showing in React Native + React Native Paper app

查看:59
本文介绍了图标未显示在 React Native + React Native Paper 应用程序中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个使用 React Native Paper 的全新 React Native 应用程序.我按照

例如,我在此屏幕的顶部有一个 Searchbar,其中包含以下代码.据我所知,我什至不必在那里指定一个图标.它应该会自动显示一个放大镜,但没有显示图标.

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

知道为什么以及如何修复它吗?

解决方案

停止您的应用程序.然后进入项目目录>打开cmd>运行npx react-native link react-native-vector-icons

cmd 会显示链接成功

现在再次运行您的应用

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?

解决方案

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

这篇关于图标未显示在 React Native + React Native Paper 应用程序中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆