Alloy.Controller.UI

Provides convenience methods for working with Titanium UI objects.

Defined By

Methods

Alloy.Controller.UI
( apiName, opts ) : Titanium.UI.View/Alloy.Controller
Creates a Titanium UI object with the specified styles. ...

Creates a Titanium UI object with the specified styles.

Example

The following creates a new View object and assigns the "dialog" TSS class (defined elsewhere) to the view, and finally adds it to main window.

var view = $.UI.create("View", {
    classes: 'dialog'
});
$.index.add(view);

Since 1.2.0

Parameters

  • apiName : String

    Name of the Titanium object to create. This can either be the full class name, such as Ti.UI.Button, or the XML element, such as Button.

  • opts : AlloyStyleDict

    Dictionary of styles to apply. opts may also contain any additional properties you would like to apply directly the created Titanium object.

Returns