I need an delete button and want to use this trashcan icon you can find everywhere in iOS. How can I display this systemwide trashcan icon React Native instead of displaying my own icon in an Image-View?
2 Answers
There is a node module you can use which gives you access to font icons the likes of Ion and FontAwesome where you can find pretty much any icon you want to use. It's really simple to install and use of iOS & Android. https://github.com/oblador/react-native-vector-icons
3 Comments
That's a very good question, but I guess that's not possible.
In the iOS SDK the only way to display the standard icons is creating a certain type of UIBarButton by choosing the UIBarButtonSystemItem type as detailed here but as far as I've seen the React Native library doesn't create UIBarButton but only tapable elements like TEXT or composed view of IMAGE and TEXT wrapped in at TouchableHighlight so that specification doesn't seem to be exposed...
If someone finds a way in the iOS SDK, without using private API, to access the PNGs used in the standard button icons I think that behavior could be easily added to the the IMAGE class.
Stefano
1 Comment
<Image/> and a <Text/> in a <TouchableHighlight/>? Are the iOS images available somewhere?
react-native-vector-iconscame into existence.