Styles applied to the icon only, good for setting margins or a different color. Text and icon color, use iconStyle or nest a Text component if you need different colors. Import Icon from 'react-native-vector-icons/FontAwesome' const myButton = ( Īny Text, TouchableHighlight or TouchableWithoutFeedback property in addition to these: Prop NOTE: On android Text doesn't currently support border* styles, to circumvent this simply wrap your Icon with a View.īy combining some of these you can create for example :Ī convenience component for creating buttons with an icon on the left side. Since Icon builds on top of the Text component, most style properties will work as expected, you might find it useful to play around with these: Usage: const isNameValid = Icon.hasIcon(name) Usage: const glyphMap = Icon.getRawGlyphMap()Ĭhecks if the name is valid in current icon set. Returns the raw glyph map of the icon set. Usage: const source = Icon.getImageSourceSync(name, size, color) Usage: const source = await Icon.getImageSource(name, size, color) Returns a promise that resolving to the source of a bitmap version of the icon for use with Image component et al. Usage: const fontFamily = Icon.getFontFamily() Returns the font family that is currently used to retrieve icons as text. What icon to show, see Icon Explorer app or one of the links above. Size of the icon, can also be passed as fontSize in the style object. Import Icon from 'react-native-vector-icons/FontAwesome' const myIcon = PropertiesĪny Text property and the following: Prop In your webpack configuration file, add a section to handle ttf files using url-loader (or file-loader) Note: you need to recompile your project after adding new fonts.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |