我尝试在我的反应原生应用程序中使用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",意思是"固体"。如何将其更改为"浅色"?
import FontAwesome5Pro from 'react-native-vector-icons/FontAwesome5Pro';
const icon = <FontAwesome5Pro name={'comments'} light />;