Home >Web Front-end >JS Tutorial >React Native implements custom icons
This article mainly shares with you a method of implementing custom icons in React Native. It has a good reference value and I hope it will be helpful to everyone. Let’s follow the editor to have a look.
Take the react-native-vector-icons component as an example
Use the Ionicons.ttf font, which is introduced in the
node_modules/react-native-vector-icons/Fonts/Ionicons.ttf
method
import Icon from 'react-native-vector-icons/Ionicons';
Open http://fontstore.baidu.com/static/editor/index.html, open the Ionicons.ttf font
You can go to http:// www.iconfont.cn/Search for icons and download svg format
Click on the newly imported icon to modify the "glyph information"
Open
node_modules/react-native-vector-icons/glyphmaps/Ionicons.json
Add the corresponding value, do not repeat it with the existing one
Finally in the component The effect of using
is as follows
The above is the detailed content of React Native implements custom icons. For more information, please follow other related articles on the PHP Chinese website!