# Titanium.UI
The main Titanium.UI module.
# Overview
The UI module is responsible for native user-interface components and interaction inside Titanium. The goal of the UI module is to provide a native experience along with native performance by compiling Javascript code into their native counterparts as part of the build process.
# Design
The UI module is broken down into 3 major area:
Views - Titanium.UI.View are containers that host visual elements such as controls or other views. Views can have their properties customized, such as their border color and radius, can fire events such as swipe events or touches, and can optionally contain a hierarchy or other views as children. In Titanium, most views are specialized to perform both a visual function and set of interaction behaviors such as Titanium.UI.TableView or Titanium.UI.iOS.CoverFlowView. Views are always named with the suffix
View
.Controls - controls, or sometimes referred as widgets, are visual elements such as Titanium.UI.Slider, Titanium.UI.Button and Titanium.UI.Switch. They provide a visual element which has a defined behavior and typical have special configuration and special events. Controls themselves are views and also inherit a views properties, functions and events.
Windows - Titanium.UI.Window are typically top-level visual constructs that are the main part of your interface. An application will always have at least one window and windows can take different shapes and sizes, can have display and interaction properties such as fullscreen or modal and can be customized, such as changing their opacity or background color. Windows themselves are views and also inherit a views properties, functions and events. There are a few specialization of Windows such as a Titanium.UI.TabGroup which offer additional behavior beyond the basic Window. It is considered a best practice to use a Titanium.UI.NavigationWindow as the root of your application.
Titanium uses the Factory Pattern (opens new window) for constructing objects and a general naming pattern for APIs. For example, to construct a Titanium.UI.AlertDialog, you call the method Titanium.UI.createAlertDialog. To create a Titanium.UI.TextArea, you call the method Titanium.UI.createTextArea. Once an object is created, it will be available until it goes out of scope.
# Optimizations
UI objects are optimized by Titanium to not be realized into the drawing context and placed into
the device UI surface until needed. That means that you can create UI objects, set their
properties and add them to their hierarchy without much worry about memory or performance.
When the native drawing surface needs to render a specific view or control, Titanium will
automatically create the view as needed. Additionally, Titanium is optimized to also release
memory once the view is no longer needed, on screen or in low memory situations. However, it's
a good idea to help Titanium along in certain cases where you are no longer using objects. For
example, you should call close
on a Titanium.UI.Window instance when you are no
longer using it. You can safely call open
on the window again to re-open it.
# Global Context
Prior to the release of Titanium SDK 9.0.0.GA
any variable declared in app.js
or alloy.js
was added to a global scope. This however is no longer the case since 9.0.0.GA
. However
it is still possible to add variables to a global scope by adding global.
in front of any
variabled declared in app.js
or alloy.js
. However you should be careful with adding variables
to global context because anything added to the global context will not be garbage-collected.
In Alloy the recommended way to add global context is Alloy.Globals
.
# Portability
Titanium components are designed to be portable across as many platforms as it supports. However, there are cases where a device either does not support a specific feature or capability or where it support additional functionality. For cases where the device OS supports capabilities that other platforms do not, we attempt to place those capabilities in a separate namespace, such as Titanium.UI.iOS. However, in cases where the control is in a common namespace and support additional features, we continue to place that functionality directly on the object.
# Events
Event listeners must be defined before their respective events are likely to be fired, otherwise they are not guaranteed to be called. The open and focus Titanium.UI.Window event listeners, for instance, must be defined before the window is opened.
Evaluating events as late as possible while bearing the above consideration in mind, however, can significantly improve application responsiveness. For example, an event listener for a click event may be defined after the parent window has been opened.
Adding eventListeners
in Alloy makes sure they are bound before they are fired.
# Colors
Many UI components have properties that control their color.
Colors may be specified as a hex triplet to determine the red, green and blue channels. Thus,
'#000000'
is specified for black, '#ff0000'
for red, '#00ff00'
for green, '#0000ff'
for
blue, and '#ffffff'
for white, etc. A channel may be abbreviated when its two hex digits are
identical, such as '#000'
, '#f00'
, '#0f0#'
, '#00f'
and '#fff'
for the above colors,
respectively.
An additional alpha channel is supported as a prefix to the hex triplet (ARGB or AARRGGBB). So, to make
the purple-like color '#ff00ff'
semi-opaque, you could use an alpha value of '55'
, giving,
'#55ff00ff'
or '#5f0f'
. Please note that both iOS and Android use ARGB format, while typical CSS supports RGBA.
Note that while the pound symbol, #
, is not mandatory on iOS when using the hex triplet format,
it is recommended to include it to provide compatibility with other platforms.
iOS and Android also accept colors specified in the form, rgb(R,G,B)
and rgba(R,G,B,A)
, with the color
channels inside the parethesis represented by integer numbers between 0
and 255
and the
alpha channel by a float number between 0
and 1.0
(transparent to opaque, respectively).
For example, an opaque purple could be obtained using 'rgb(255,0,255)'
and a semi-opaque purple
using 'rgba(255,0,255,0.3)'
. Note that although this format will work if the rgb
or rgba
prefix is omitted, this is not officially supported and thus not recommended.
Alternatively, the following set of color names are recognized.
'aqua'
, 'black'
, 'blue'
, 'brown'
, 'cyan'
, 'darkgray'
, 'fuchsia'
, 'gray'
,
'green'
, 'lightgray'
, 'lime'
, 'magenta'
, 'maroon'
, 'navy'
, 'olive'
, 'orange'
,
'pink'
, 'purple'
, 'red'
, 'silver'
, 'teal'
, 'white'
, 'yellow'
.
All color properties also accept a value of 'transparent'
.
On Android, if you want to create a semi-transparent window, set the opacity
property before opening the window.
On iOS, you can set a global tinting using Titanium.UI.tintColor. All child views will inherit
the tint color by default and are able to override the color using tintColor
on their own views.
The default tintColor
on iOS is the blue (system-color).
If a color property is undefined, the default color of the particular UI element is applied. If a color value is not valid on iOS, the default color is applied, whereas, on Android, the color yellow is applied.
On iOS, you may use named system colors. See the Titanium.UI.Color documentation for more details.
# Dark Mode
In iOS 13 Apple introduced support for users to adopt a system-wide Dark Mode setting where the screens, view, menus, and controls use a darker color palette. You can read more about this in the Apple Human Interface Guidelines.
There are two aspects to dark mode that can be specified for your app, colors and images.
# Specifying Dark Mode colors
To specify colors for dark mode, also known as semantic colors, first create a file called semantic.colors.json
in the Resources directory for classic applications, or in the assets directory for Alloy applications. Then you can specify color names in the following format:
{
"textColor": { // the name for your color
"dark": {
"color": "#ff85e2", // hex color code to be set
"alpha": "50" // can be set from a range of 0.0-100.0, integer or float
},
"light": "#ff1f1f" // can be a hex color (with alpha via ARGB/AARRGGBB)
}
}
To reference these colors in your application use the Titanium.UI.fetchSemanticColor API, this is a cross platform API that on iOS 13 and above will use the native method that checks the users system-wide setting, and in all other instances will check the Titanium.UI.semanticColorType property and return the correct color for the current setting.
You may also directly use the named of the colors as values to any color properties on UI elements.
# Specifying Dark Mode images
Note: Dark Mode images are iOS only.
To specify dark mode images, use the -dark
suffix on the image name. When building your app the images are set as the dark mode variant, then refer to images as normal and iOS will select the correct image dependent on the users system-wide setting.
For example given an image logo.png
with @2x
and @3x
variants, the following dark mode images should exist:
- logo-dark.png
- logo-dark@2x.png
- logo-dark@3x.png
And you would reference the image as before using logo-dark.png
Android:
You can use the native app/assets/android/images/res-night
folder (extend them with e.g. res-night-xxhdpi
if needed) for dark-mode images.
# Examples
# Color Demo
The following example demonstrates all the color formats, and color names, that are intended to be supported by Titanium. See the Titanium.UI section for details.
var colorArray = [
'#ff00ff', '#f0f', 'rgb(255,0,255)',
'transparent', '#55ff00ff', '#5f0f', 'rgba(255,0,255,0.3)',
'aqua', 'black', 'blue', 'brown', 'cyan', 'darkgray', 'fuchsia', 'gray', 'green',
'lightgray', 'lime', 'magenta', 'maroon', 'navy', 'olive', 'orange', 'pink',
'purple', 'red', 'silver', 'teal', 'white', 'yellow',
];
var win = Ti.UI.createWindow({
backgroundColor: 'black',
exitOnClose: true,
fullscreen: false,
layout: 'vertical',
title: 'Color Demo'
});
var rows = [];
var row;
for (var i=0, ilen = colorArray.length; i < ilen; i++){
row = Ti.UI.createTableViewRow({
color:'black',
backgroundColor: colorArray[i],
title: colorArray[i],
height: 40
});
rows.push(row);
}
var table = Ti.UI.createTableView({
data: rows,
backgroundColor: 'white'
});
win.add(table);
win.open();
# Properties
# apiName READONLY
The name of the API that this proxy corresponds to.
The value of this property is the fully qualified name of the API. For example, Titanium.UI.Button
returns Ti.UI.Button
.
# availableSystemFontFamilies READONLY
Returns a list of font families that are provided by the system.
# backgroundColor
Sets the background color of the master view (when there are no windows or other top-level controls displayed).
The default background color may also show through if you use semi-transparent windows.
# backgroundImage
Local path or URL to an image file for setting a background for the master view (when there are no windows or other top-level controls displayed).
The default background image may also show through if you use semi-transparent windows.
# bubbleParent
Indicates if the proxy will bubble an event to its parent.
Some proxies (most commonly views) have a relationship to other proxies, often established by the add() method. For example, for a button added to a window, a click event on the button would bubble up to the window. Other common parents are table sections to their rows, table views to their sections, and scrollable views to their views. Set this property to false to disable the bubbling to the proxy's parent.
Default: true
# cutoutSize READONLY
Returns the position and shape of the Android notch. Read more about the notch here.
Using Android 9+ it will return the bounding box of the Android notch. It will return top
,left,
widthand
height`.
# lifecycleContainer
The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.
If this property is set to a Window or TabGroup, then the corresponding Activity lifecycle event callbacks will also be called on the proxy. Proxies that require the activity lifecycle will need this property set to the appropriate containing Window or TabGroup.
# overrideUserInterfaceStyle
Forces the app to used assigned theme instead of the system theme.
When set to USER_INTERFACE_STYLE_DARK or USER_INTERFACE_STYLE_LIGHT, the app will ignore the system's current theme and use the theme assigned to this property instead.
When set to USER_INTERFACE_STYLE_UNSPECIFIED, the app will use the system's current theme. To determine what the system's current theme is, you must read the userInterfaceStyle property.
See UI_MODE_NIGHT_MASK.
Default: Titanium.UI.USER_INTERFACE_STYLE_UNSPECIFIED
# semanticColorType DEPRECATED
DEPRECATED SINCE 9.1.0
Use userInterfaceStyle instead.
The current mode for the device (corresponding to night/dark or light/normal)
# statusBarHeight READONLY
The total height of the status bar including safe area padding.
Use this property to determine an absolute spacing to the top in full screen windows. Note: For a more flexible approach, e.g. when allowing rotation, we recommend using the safeAreaPadding property of the related window.
# tintColor
Sets the global tint color of the application. It is inherited by the child views and can be
overwritten by them using the tintColor
property.
# userInterfaceStyle READONLY
The style associated with the user interface.
Use this property to determine whether your interface should be configured with a dark or light appearance. The default value of this trait is set to the corresponding appearance setting on the user's device.
See UI_MODE_NIGHT_MASK.
# Methods
# addEventListener
Adds the specified callback as an event listener for the named event.
Parameters
Name | Type | Description |
---|---|---|
name | String | Name of the event. |
callback | Callback<Titanium.Event> | Callback function to invoke when the event is fired. |
Returns
- Type
- void
# applyProperties
Applies the properties to the proxy.
Properties are supplied as a dictionary. Each key-value pair in the object is applied to the proxy such that myproxy[key] = value.
Parameters
Name | Type | Description |
---|---|---|
props | Dictionary | A dictionary of properties to apply. |
Returns
- Type
- void
# convertUnits
Converts one type of unit to another using the metrics of the main display.
As this method does not support percentages, 0
is returned if they are specified.
Parameters
Name | Type | Description |
---|---|---|
convertFromValue | String | Measurement and optional unit to convert from, i.e. 160, "120dip". Percentages are not accepted. |
convertToUnits | Number | Desired unit for the conversion result. |
Returns
- Type
- Number
# createActivityIndicator
Creates and returns an instance of Titanium.UI.ActivityIndicator.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.ActivityIndicator> | Properties to set on a new object, including any defined by Titanium.UI.ActivityIndicator except those marked not-creation or read-only. |
Returns
# createAlertDialog
Creates and returns an instance of Titanium.UI.AlertDialog.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.AlertDialog> | Properties to set on a new object, including any defined by Titanium.UI.AlertDialog except those marked not-creation or read-only. |
Returns
# createAnimation
Creates and returns an instance of Titanium.UI.Animation.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.Animation> | Properties to set on a new object, including any defined by Titanium.UI.Animation except those marked not-creation or read-only. |
Returns
# createAttributedString
Creates and returns an instance of Titanium.UI.AttributedString.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.AttributedString> | Properties to set on a new object, including any defined by Titanium.UI.AttributedString except those marked not-creation or read-only. |
Returns
Creates and returns an instance of Titanium.UI.Button.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.Button> | Properties to set on a new object, including any defined by Titanium.UI.Button except those marked not-creation or read-only. |
Returns
- Type
- Titanium.UI.Button
Creates and returns an instance of Titanium.UI.ButtonBar.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.ButtonBar> | Properties to set on a new object, including any defined by Titanium.UI.ButtonBar except those marked not-creation or read-only. |
Returns
# createColor
Creates and returns an instance of Titanium.UI.Color.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.Color> | Properties to set on a new object, including any defined by Titanium.UI.Color except those marked not-creation or read-only. |
Returns
- Type
- Titanium.UI.Color
# createDashboardItem
Creates and returns an instance of Titanium.UI.DashboardItem.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.DashboardItem> | Properties to set on a new object, including any defined by Titanium.UI.DashboardItem except those marked not-creation or read-only. |
Returns
# createDashboardView
Creates and returns an instance of Titanium.UI.DashboardView.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.DashboardView> | Properties to set on a new object, including any defined by Titanium.UI.DashboardView except those marked not-creation or read-only. |
Returns
# createEmailDialog
Creates and returns an instance of Titanium.UI.EmailDialog.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.EmailDialog> | Properties to set on a new object, including any defined by Titanium.UI.EmailDialog except those marked not-creation or read-only. |
Returns
# createImageView
Creates and returns an instance of Titanium.UI.ImageView.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.ImageView> | Properties to set on a new object, including any defined by Titanium.UI.ImageView except those marked not-creation or read-only. |
Returns
# createLabel
Creates and returns an instance of Titanium.UI.Label.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.Label> | Properties to set on a new object, including any defined by Titanium.UI.Label except those marked not-creation or read-only. |
Returns
- Type
- Titanium.UI.Label
# createListSection
Creates and returns an instance of Titanium.UI.ListSection.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.ListSection> | Properties to set on a new object, including any defined by Titanium.UI.ListSection except those marked not-creation or read-only. |
Returns
# createListView
Creates and returns an instance of Titanium.UI.ListView.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.ListView> | Properties to set on a new object, including any defined by Titanium.UI.ListView except those marked not-creation or read-only. |
Returns
- Type
- Titanium.UI.ListView
# createMaskedImage
Creates and returns an instance of Titanium.UI.MaskedImage.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.MaskedImage> | Properties to set on a new object, including any defined by Titanium.UI.MaskedImage except those marked not-creation or read-only. |
Returns
# createMatrix2D
Creates and returns an instance of Titanium.UI.Matrix2D.
Parameters
Name | Type | Description |
---|---|---|
parameters | Matrix2DCreationDict | Initial transformation of the matrix. |
Returns
- Type
- Titanium.UI.Matrix2D
# createMatrix3D
Creates and returns an instance of Titanium.UI.Matrix3D.
Parameters
Name | Type | Description |
---|---|---|
parameters | Matrix3DCreationDict | Initial transformation of the matrix. |
Returns
- Type
- Titanium.UI.Matrix3D
Creates and returns an instance of Titanium.UI.NavigationWindow.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.NavigationWindow> | Properties to set on a new object, including any defined by Titanium.UI.NavigationWindow except those marked not-creation or read-only. |
Returns
# createNotification
Creates and returns an instance of Titanium.UI.Notification.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.Notification> | Properties to set on a new object, including any defined by Titanium.UI.Notification except those marked not-creation or read-only. |
Returns
# createOptionBar
Creates and returns an instance of Titanium.UI.OptionBar.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.OptionBar> | Properties to set on a new object, including any defined by Titanium.UI.OptionBar except those marked not-creation or read-only. |
Returns
# createOptionDialog
Creates and returns an instance of Titanium.UI.OptionDialog.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.OptionDialog> | Properties to set on a new object, including any defined by Titanium.UI.OptionDialog except those marked not-creation or read-only. |
Returns
# createPicker
Creates and returns an instance of Titanium.UI.Picker.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.Picker> | Properties to set on a new object, including any defined by Titanium.UI.Picker except those marked not-creation or read-only. |
Returns
- Type
- Titanium.UI.Picker
# createPickerColumn
Creates and returns an instance of Titanium.UI.PickerColumn.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.PickerColumn> | Properties to set on a new object, including any defined by Titanium.UI.PickerColumn except those marked not-creation or read-only. |
Returns
# createPickerRow
Creates and returns an instance of Titanium.UI.PickerRow.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.PickerRow> | Properties to set on a new object, including any defined by Titanium.UI.PickerRow except those marked not-creation or read-only. |
Returns
# createProgressBar
Creates and returns an instance of Titanium.UI.ProgressBar.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.ProgressBar> | Properties to set on a new object, including any defined by Titanium.UI.ProgressBar except those marked not-creation or read-only. |
Returns
# createRefreshControl
Creates and returns an instance of Titanium.UI.RefreshControl.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.RefreshControl> | Properties to set on a new object, including any defined by Titanium.UI.RefreshControl except those marked not-creation or read-only. |
Returns
# createScrollableView
Creates and returns an instance of Titanium.UI.ScrollableView.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.ScrollableView> | Properties to set on a new object, including any defined by Titanium.UI.ScrollableView except those marked not-creation or read-only. |
Returns
# createScrollView
Creates and returns an instance of Titanium.UI.ScrollView.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.ScrollView> | Properties to set on a new object, including any defined by Titanium.UI.ScrollView except those marked not-creation or read-only. |
Returns
# createSearchBar
Creates and returns an instance of Titanium.UI.SearchBar.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.SearchBar> | Properties to set on a new object, including any defined by Titanium.UI.SearchBar except those marked not-creation or read-only. |
Returns
# createShortcut
Creates and returns an instance of Titanium.UI.Shortcut.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.Shortcut> | Properties to set on a new object, including any defined by Titanium.UI.Shortcut except those marked not-creation or read-only. |
Returns
- Type
- Titanium.UI.Shortcut
# createShortcutItem
Creates and returns an instance of Titanium.UI.ShortcutItem.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.ShortcutItem> | Properties to set on a new object, including any defined by Titanium.UI.ShortcutItem except those marked not-creation or read-only. |
Returns
# createSlider
Creates and returns an instance of Titanium.UI.Slider.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.Slider> | Properties to set on a new object, including any defined by Titanium.UI.Slider except those marked not-creation or read-only. |
Returns
- Type
- Titanium.UI.Slider
# createSwitch
Creates and returns an instance of Titanium.UI.Switch.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.Switch> | Properties to set on a new object, including any defined by Titanium.UI.Switch except those marked not-creation or read-only. |
Returns
- Type
- Titanium.UI.Switch
# createTab
Creates and returns an instance of Titanium.UI.Tab.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.Tab> | Properties to set on a new object, including any defined by Titanium.UI.Tab except those marked not-creation or read-only. |
Returns
- Type
- Titanium.UI.Tab
# createTabbedBar
Creates and returns an instance of Titanium.UI.TabbedBar.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.TabbedBar> | Properties to set on a new object, including any defined by Titanium.UI.TabbedBar except those marked not-creation or read-only. |
Returns
# createTabGroup
Creates and returns an instance of Titanium.UI.TabGroup.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.TabGroup> | Properties to set on a new object, including any defined by Titanium.UI.TabGroup except those marked not-creation or read-only. |
Returns
- Type
- Titanium.UI.TabGroup
# createTableView
Creates and returns an instance of Titanium.UI.TableView.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.TableView> | Properties to set on a new object, including any defined by Titanium.UI.TableView except those marked not-creation or read-only. |
Returns
# createTableViewRow
Creates and returns an instance of Titanium.UI.TableViewRow.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.TableViewRow> | Properties to set on a new object, including any defined by Titanium.UI.TableViewRow except those marked not-creation or read-only. |
Returns
# createTableViewSection
Creates and returns an instance of Titanium.UI.TableViewSection.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.TableViewSection> | Properties to set on a new object, including any defined by Titanium.UI.TableViewSection except those marked not-creation or read-only. |
Returns
# createTextArea
Creates and returns an instance of Titanium.UI.TextArea.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.TextArea> | Properties to set on a new object, including any defined by Titanium.UI.TextArea except those marked not-creation or read-only. |
Returns
- Type
- Titanium.UI.TextArea
# createTextField
Creates and returns an instance of Titanium.UI.TextField.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.TextField> | Properties to set on a new object, including any defined by Titanium.UI.TextField except those marked not-creation or read-only. |
Returns
# createToolbar
Creates and returns an instance of Titanium.UI.Toolbar.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.Toolbar> | Properties to set on a new object, including any defined by Titanium.UI.Toolbar except those marked not-creation or read-only. |
Returns
- Type
- Titanium.UI.Toolbar
# createView
Creates and returns an instance of Titanium.UI.View.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.View> | Properties to set on a new object, including any defined by Titanium.UI.View except those marked not-creation or read-only. |
Returns
- Type
- Titanium.UI.View
# createWebView
Creates and returns an instance of Titanium.UI.WebView.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.WebView> | Properties to set on a new object, including any defined by Titanium.UI.WebView except those marked not-creation or read-only. |
Returns
- Type
- Titanium.UI.WebView
# createWindow
Creates and returns an instance of Titanium.UI.Window.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Titanium.UI.Window> | Properties to set on a new object, including any defined by Titanium.UI.Window except those marked not-creation or read-only. |
Returns
- Type
- Titanium.UI.Window
# fetchSemanticColor
Fetches the correct color to be used with a UI element dependent on the users current dark mode setting on iOS 13 and above, or the semanticColorType setting in other instances.
Will return a valid string value to be used for color properties on Android. This may be a hex string or an rgba()
function.
Parameters
Name | Type | Description |
---|---|---|
colorName | String | Name of the semantic color defined in the applications colorset. |
Returns
- Type
- Titanium.UI.Color | String
# fireEvent
Fires a synthesized event to any registered listeners.
Parameters
Name | Type | Description |
---|---|---|
name | String | Name of the event. |
event | Dictionary | A dictionary of keys and values to add to the Titanium.Event object sent to the listeners. |
Returns
- Type
- void