我在React Native方面经验很少。因此,为什么有人可以推荐我如何做这种屏幕?只是建议使用什么。我自己做。我想学习
wxj343302733 回答:React Native中的布局设计图标
首先,您必须安装react-native-vector-icons
,它需要链接。
然后,如果您使用第三个UI库,例如react-native-eleemnt
,则可以这样使用它:
import { Icon } from 'react-native-elements'
<Icon
name='ios-american-football'
type='ionicon'
color='#517fa4'
/>
它有很多图标。您可以选择一种类型。
它还支持自定义图标字体。我使用此site获取用于创建字体的字体资源。然后您可以使用以下代码创建自定义图标。
import React from 'react';
import {createIconSet,createIconSetFromFontello} from 'react-native-vector-icons';
const CustomFontConfig = require('../Config/CustomFontConfig.json');
const iconSet = createIconSetFromFontello(CustomFontConfig,'fontello');
export default iconSet;