【发布时间】:2019-06-09 12:11:36
【问题描述】:
我尝试在我的 react-native 应用程序中使用 Font Awesome Pro 灯图标。
我导入了我需要的包并将库添加到我想要使用的图标中。
import { library } from '@fortawesome/fontawesome-svg-core';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import {faIgloo} from '@fortawesome/fontawesome-pro';
...
//App.js
class App extends React.Component {
render() {
library.add(faIgloo);
return (
<View style={styles.container}>
<MainNavigator />
</View>
);
}
}
//Slides.js where I want to show icon.
...
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
...
renderSlides(){
return(
<View>
<FontAwesomeIcon icon="fa-igloo" />
</View>);
});
}
但问题是,图标的前缀是“fas”,意思是'solid'。如何将其更改为'light'?
【问题讨论】:
-
您应该使用 react-native-vector-icons 以获得最佳体验。