Identifies UI elements in the controller (prefixed with
Applies additional styles (prefixed with
|Enables the autostyle feature for dynamic styling when adding or removing classes. See Dynamic Styles: Autostyle for more details.|
Acts as a compiler directive for size-specific view components. Value can either be
|Use a custom query to apply additional styles to the element. See Conditional code and Alloy Styles and Themes: Custom Query Styles for more details.|
|Requires in a CommonJS module. Note that the XML element must be named after a |
Overrides the default
Switches the namespace based on the platform and acts as a compiler directive for platform-specific view components. Values can be any combination of platforms. See Conditional code and Namespace for more details.
Assigns values to UI object properties. See Property mapping for more details.
Assigns callbacks to UI object events. See Event handling for more details.
The following table lists the special XML elements besides the Titanium UI components:
Root element for all view XML files. Required in all views.
|Creates a singleton or instance of the specified collection. See the Collection element for more details.|
|Creates a singleton or instance of the specified model. See the Model element for more details.|
|Imports a module view inside this view. See the Module element for more details.|
Imports a widget or includes another view inside this view. See the Require element for more details.
index.xml is a special case that only accepts the following view components as direct children of the Alloy tag:
To bind a callback to an event in a required view using the
on attribute as detailed in Event Handling below, add an event listener for the UI component to trigger the event. For example, suppose you want to require a view that only contains a button. In the parent view, you require the button view and assign a callback to the click event:
- AlertDialog or Ti.UI.AlertDialog
- ButtonBar or Ti.UI.ButtonBar
- CoverFlowView or Ti.UI.iOS.CoverFlowView
- DashboardView or Ti.UI.iOS.DashboardView
- ListView or Ti.UI.ListView
- Map or Ti.Map
- Menu or Ti.Android.Menu
- OptionBar or Ti.UI.OptionBar
- OptionDialog or Ti.UI.OptionDialog
- Picker or Ti.UI.Picker
- SplitWindow or Ti.UI.iOS.SplitWindow
- TabbedBar or Ti.UI.iOS.TabbedBar
- Toolbar or Ti.UI.Toolbar