Adding images to notes
Our note-taking application is shaping up nicely, but a picture is worth a thousand words, so wouldn't it be nice if we could take a photo and store it with a note? Since React Native does not ship with a camera component, we'll need to use a very popular component created by Lochlan Wansbrough. The source code can be found at: https://github.com/lwansbrough/react-native-camera.
At this point, you are most likely familiar with the addition of new screens to our navigation. Let's quickly write the navigation code for the CameraScreen
before we include the Native Module. In the NavigationBarRouteMapper
, add the camera
route to the LeftButton
and Title
attributes:
var NavigationBarRouteMapper = { LeftButton: function(route, navigator, index, navState) { switch (route.name) { case 'home': return ( <SimpleButton onPress={() => navigator.push({name: 'noteLocations'})} customText='Map' style={styles.navBarLeftButton...