# Titanium.UI.iOS.CoverFlowView
The cover flow view is a container showing animated three-dimensional images in a style consistent with the cover flow presentation style used for iPod, iTunes, and file browsing.
# Overview
The cover flow view is created by the Titanium.UI.iOS.createCoverFlowView method or
<CoverFlowView>
element in an Alloy application.
# Examples
# Simple 3 image cover flow example
Create a simple cover flow view.
var view = Titanium.UI.iOS.createCoverFlowView({
backgroundColor:'#000',
images:['a.png','b.png','c.png']
});
window.add(view);
# Alloy XML Markup
Previous example as an Alloy view.
<Alloy>
<Window id="window">
<CoverFlowView id="view" platform="ios" backgroundColor="#000">
<!-- The Images tag sets the CoverFlowView.images property. -->
<Images>
<!-- Assign the image by node text or the image attribute. -->
<!-- Can also specify the width and height attributes. -->
<Image>a.png</Image>
<Image>b.png</Image>
<Image>c.png</Image>
</Images>
<!-- Place additional views for the CoverFlowView here. -->
</CoverFlowView>
</Window>
</Alloy>
# Properties
# images
Images to display in the view.
In an Alloy application, you can use a <Images>
element.
# Methods
# setImage
Changes the image for a specified index.
To specify a size for the image, you may pass the image as a simple dictionary, as defined in CoverFlowImageType. If you specify a size, the size must be exact, not a percentage size.
If the image is passed as a File
object or file path, the filename is checked. If the
filename includes the '@2x' or '@3x' string used to identify high-resolution images for the Retina (HD)
display, the image is treated accordingly.
Parameters
Name | Type | Description |
---|---|---|
index | Number | Index to add the image at. |
image | String | Titanium.Blob | Titanium.Filesystem.File | CoverFlowImageType | Image to add at this index. |
Returns
- Type
- void
# Events
# click
Fired when the user clicks on the view.
There is a subtle difference between singletap and click events.
A singletap event is generated when the user taps the screen briefly without moving their finger. This gesture will also generate a click event.
However, a click event can also be generated when the user touches, moves their finger, and then removes it from the screen.
On Android, a click event can also be generated by a trackball click.
Properties
Name | Type | Description |
---|---|---|
index | Number | Index of the image that is now visible. |
previous | Number | Index of the previously-visible image. |
source | Object | Source object that fired the event. |
type | String | Name of the event fired. |
bubbles | Boolean | True if the event will try to bubble up if possible. |
cancelBubble | Boolean | Set to true to stop the event from bubbling. |
# change
Fired when the user changes the image using a gesture.
Properties
Name | Type | Description |
---|---|---|
index | Number | Index of the image that is now visible. |
previous | Number | Index of the previously-visible image. |
source | Object | Source object that fired the event. |
type | String | Name of the event fired. |
bubbles | Boolean | True if the event will try to bubble up if possible. |
cancelBubble | Boolean | Set to true to stop the event from bubbling. |