如果你遇到写了英文后不出现icon的时候,可能的原因:1 可能是你的英语单词不正确,比如邮箱是mail,如果写成email,就无法显示。人物icon,如果写成add-user是无法显示的,正确写法是‘user’,从哪里可以知道这些图标的名字,通过源码,比如:
项目中使用的native-base。 里面看到:
interface Icon extends Testable {
name: string;
type?: "AntDesign" | "Entypo" | "EvilIcons" | "Feather" | "FontAwesome" | "FontAwesome5" | "Foundation" | "Ionicons" | "MaterialCommunityIcons" | "MaterialIcons" | "Octicons" | "SimpleLineIcons" | "Zocial";
// TODO position attribute of ReactNative.FlexStyle hasn't another position values without "absolute" and "relative"
style?: any;
onPress?: (e?: any) => any;
active?: boolean;
ios?: string;
android?: string;
color?: string;
fontSize?: number;
}
去AntDesign中找。