Displaying photos using ScrollableView
One of the most common methods of displaying multiple photographs and images in mobile devices is ScrollableView
. This view type allows pictures to be swiped to the left and right, and is common among many applications, including Facebook mobile. The method of showing images in this way is reminiscent of flipping through a book or an album, and is very popular due to the natural feel and simple implementation.
In this recipe, we will implement a ScrollableView
object. It will contain any number of images, which can be chosen from the camera or photo gallery. The complete source code for this recipe can be found in the /Chapter 4/Recipe 4
folder.
How to do it...
Firstly, let's create our ScrollableView
object, which we will call scrollingView
, and add it to our app.js
file and the win1
window:
//this is the scroll view the user will use to swipe //through the selected photos var scrollingView = Ti.UI.createScrollableView({ left: 17, top: 15, ...