O'Reilly logo

React Native Cookbook by Crysfel Villa, Stan Bershadskiy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Display images in full screen

In this recipe we will create a timeline of images, then we will allow the user to press any of the images to display it with a black background and the image in the center of the screen.

We will use an opacity animation for the background and we will slide in the image from their original position.

Getting ready

Let's create an empty app; we are going to call it PhotoViewer. Feel free to use any other name, just make sure to set the correct name when registering the bootstrap component.

In addition, we need to create three files for this project. src/MainApp.js to display the timeline, src/PostContainer/index.js to show each image in the timeline and src/PhotoViewer/index.js to show the selected image in full screen. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required