Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
955 views
in Technique[技术] by (71.8m points)

android - Icon not showing in react-native

I am using react-native-vector-icons library for showing icons in tabbar like shown below :

import FontAwesome from 'react-native-vector-icons/FontAwesome';

<FontAwesome name='trophy' />

But it's not showing icon, so what to do for this?

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Icon display wrong because it can not find the font. I think you need to check if the bundle contains these .ttf files.

If not, Here is the guide i found from docs

The result of icon i tested with your code:

Code:

Result: enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...