Skip to content
Titanium SDK
Version13.1.1

You are reading 13.1.1. See this page in 13.4.1.

Titanium.UI.iOS.CoverFlowView

viewiPhoneiPadmacOSsince iPhone 0.8, iPad 0.8, macOS 9.2.0

Extends Titanium.UI.ViewTitanium.Proxy

The cover flow view is a container showing animated three-dimensional images in a style consistent with the former cover flow presentation style used for iPod, iTunes, and Finder.

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 48

apiName

Stringsince Android 3.2.0, iPhone 3.2.0, iPad 3.2.0, macOS 9.2.0read-only

Inherited from Titanium.Proxy

The name of the API that this proxy corresponds to.

Inherited from Titanium.UI.View

A background gradient for the view.

Linear and Radial Gradients

The following code excerpt creates two views, one with a linear gradient and one with a radial gradient.

var win1 = Titanium.UI.createWindow({
    title:'Tab 1',
    backgroundColor:'#fff',
    layout: 'vertical'
});

var radialGradient = Ti.UI.createView({
    top: 10,
    width: 100,
    height: 100,
    backgroundGradient: {
        type: 'radial',
        startPoint: { x: 50, y: 50 },
        endPoint: { x: 50, y: 50 },
        colors: [ 'red', 'blue'],
        startRadius: 50,
        endRadius: 0,
        backfillStart: true
    }
});
var linearGradient = Ti.UI.createView({
    top: 10,
    width: 100,
    height: 100,
    backgroundGradient: {
        type: 'linear',
        startPoint: { x: '0%', y: '50%' },
        endPoint: { x: '100%', y: '50%' },
        colors: [ { color: 'red', offset: 0.0}, { color: 'blue', offset: 0.25 }, { color: 'red', offset: 1.0 } ],
    }
});
win1.add(radialGradient);
win1.add(linearGradient);
win1.open();

borderRadius

Number | String | Array<Number> | Array<String>

Inherited from Titanium.UI.View

Radius for the rounded corners of the view's border.

Default: 0

bubbleParent

Booleansince Android 3.0.0, iPhone 3.0.0, iPad 3.0.0, macOS 9.2.0

Inherited from Titanium.Proxy

Indicates if the proxy will bubble an event to its parent.

Default: true

layout

String

Inherited from Titanium.UI.View

Specifies how the view positions its children. One of: 'composite', 'vertical', or 'horizontal'.

left

Number | String

Inherited from Titanium.UI.View

View's left position, in platform-specific units.

opacity

Number

Inherited from Titanium.UI.View

Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). Defaults to 1.0 (opaque).

rect

DimensionWithAbsolutessince 2.0.0read-only

Inherited from Titanium.UI.View

The bounding box of the view relative to its parent, in system units.

rotation

NumberiPhoneiPadsince Android 5.4.0, iPhone 12.3.0, iPad 12.3.0

Inherited from Titanium.UI.View

Clockwise 2D rotation of the view in degrees.

tooltip

Stringsince 12.1.0iOS 15.0+

Inherited from Titanium.UI.View

The default text to display in the control's tooltip.

Methods 13

Inherited from Titanium.Proxy

Adds the specified callback as an event listener for the named event.

Parameters
ParametersTypeDescription
nameString

Name of the event.

callbackCallback<Titanium.Event>

Callback function to invoke when the event is fired.

4 fields
bubbles Boolean

True if the event will try to bubble up if possible.

cancelBubble Boolean

Set to true to stop the event from bubbling.

source Object

Source object that fired the event.

type String

Name of the event fired.

convertPointToView

since Android 1.8, iPhone 1.8, iPad 1.8, macOS 9.2.0

Inherited from Titanium.UI.View

Translates a point from this view's coordinate system to another view's coordinate system.

Parameters
ParametersTypeDescription
pointPoint

A point in this view's coordinate system.

If this argument is missing an x or y property, or the properties can not be converted into numbers, an exception will be raised.

destinationViewTitanium.UI.View

View that specifies the destination coordinate system to convert to. If this argument is not a view, an exception will be raised.

Returns Point

Inherited from Titanium.Proxy

Fires a synthesized event to any registered listeners.

Parameters
ParametersTypeDescription
nameString

Name of the event.

event?Dictionary

A dictionary of keys and values to add to the Titanium.Event object sent to the listeners.

getViewById

since 6.1.0

Inherited from Titanium.UI.View

Returns the matching view of a given view ID.

Parameters
ParametersTypeDescription
idString

The ID of the view that should be returned. Use the id property in your views to enable it for indexing in this method.

Inherited from Titanium.UI.View

Hides this view.

Parameters
ParametersTypeDescription
options?AnimatedOptions

Animation options for Android only. Since SDK 5.1.0 and used only on Android 5.0+

Determines whether to enable a circular reveal animation. Note that the default here is equivalent to passing in { animated: false }

insertAt

since 3.3.0

Inherited from Titanium.UI.View

Inserts a view at the specified position in the children array.

Parameters
ParametersTypeDescription
paramsViewPositionOptions

Pass an object that specifies the view to insert and optionally at which position (defaults to end)

2 fields
position? Number

Position in the children array of the view element to replace.

view Titanium.UI.View

View to insert. Required.

Inherited from Titanium.Proxy

Removes the specified callback as an event listener for the named event.

Parameters
ParametersTypeDescription
nameString

Name of the event.

callbackCallback<Titanium.Event>

Callback function to remove. Must be the same function passed to addEventListener.

4 fields
bubbles Boolean

True if the event will try to bubble up if possible.

cancelBubble Boolean

Set to true to stop the event from bubbling.

source Object

Source object that fired the event.

type String

Name of the event fired.

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
ParametersTypeDescription
indexNumber

Index to add the image at.

imageString | Titanium.Blob | Titanium.Filesystem.File | CoverFlowImageType

Image to add at this index.

3 fields
height Number

Display height of the image, in Apple points.

image String | Titanium.Blob | Titanium.Filesystem.File

Image to use, as a local file URL, Blob, or File.

width Number

Display width for the image, in Apple points.

Inherited from Titanium.UI.View

Makes this view visible.

Parameters
ParametersTypeDescription
options?AnimatedOptions

Animation options for Android only. Since SDK 5.1.0 and only used on Android 5.0+

Determines whether to enable a circular reveal animation. Note that the default here is equivalent to passing in { animated: false }

Inherited from Titanium.UI.View

Returns an image of the rendered view, as a Blob.

Parameters
ParametersTypeDescription
callback?Callback<Titanium.Blob>

Function to be invoked upon completion. If non-null, this method will be performed asynchronously. If null, it will be performed immediately.

honorScaleFactor?Boolean

Determines whether the image is scaled based on scale factor of main screen. (iOS only)

When set to true, image is scale factor is honored. When set to false, the image in the blob has the same dimensions for retina and non-retina devices.

Events 5

Fired when the user changes the image using a gesture.

Event properties
Event propertiesTypeDescription
indexNumber

Index of the image that is now visible.

previousNumber

Index of the previously-visible image.

Fired when the user clicks on the view.

Event properties
Event propertiesTypeDescription
indexNumber

Index of the image that is now visible.

previousNumber

Index of the previously-visible image.

keypressed

since Android 3.1.0, iPhone 5.4.0, iPad 5.4.0, macOS 9.2.0

Inherited from Titanium.UI.View

Fired when a hardware key is pressed in the view.

Event properties
Event propertiesTypeDescription
keyCodeNumber

The code for the physical key that was pressed. For more details, see KeyEvent. This API is experimental and subject to change.

rotate

since 12.7.0

Inherited from Titanium.UI.View

Fired when the device detects a two finger rotation.

Event properties
Event propertiesTypeDescription
rotateNumber

Rotation in degrees.