| Platform | Since |
|---|---|
| Android | 0.8 |
| iPhone | 0.8 |
| iPad | 0.8 |
| Mobile Web | 0.8 |
A multiline text field that supports editing and scrolling.
Use the Titanium.UI.createTextArea method to create a text area.
Both Text Areas and Text Fields can control the buttons displayed in a button bar above the keyboard when it's visible.
Example using a custom keyboard toolbar:
var textfield = Titanium.UI.createTextField({ color:'#336699', value:'Focus to see keyboard w/ toolbar', height:35, width:300, top:10, borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED, keyboardToolbar:[flexSpace,camera, flexSpace,tf,flexSpace, send,flexSpace], keyboardToolbarColor: '#999', keyboardToolbarHeight: 40, });
This example creates a highly customized text area.
var ta1 = Titanium.UI.createTextArea({ value:'I am a textarea', height:70, width:300, top:60, font:{fontSize:20,fontFamily:'Marker Felt', fontWeight:'bold'}, color:'#888', textAlign:'left', appearance:Titanium.UI.KEYBOARD_APPEARANCE_ALERT, keyboardType:Titanium.UI.KEYBOARD_NUMBERS_PUNCTUATION, returnKeyType:Titanium.UI.RETURNKEY_EMERGENCY_CALL, borderWidth:2, borderColor:'#bbb', borderRadius:5 });
| Name | Summary |
|---|---|
| add |
Adds a child to this view's hierarchy. |
| addEventListener |
Adds the specified callback as an event listener for the named event. |
| animate |
Animates this view. |
| blur |
Forces the text area to lose focus. |
| convertPointToView |
Translates a point from this view's coordinate system to another view's coordinate system. (Android, iPhone, iPad only.) |
| fireEvent |
Fires a synthesized event to any registered listeners. |
| focus |
Forces the text area to gain focus. |
| hasText |
Returns |
| hide |
Hides this view. |
| remove |
Removes a child view from this view's hierarchy. |
| removeEventListener |
Removes the specified callback as an event listener for the named event. |
| show |
Makes this view visible. |
| toImage |
Returns an image of the rendered view, as a Blob. (Android, iPhone, iPad only.) |
| Name | Type | Summary |
|---|---|---|
| anchorPoint | Point |
Anchor point where animation should occur, relative to the view's boundaries. (iPhone, iPad only.) |
| animatedCenterPoint | Point |
Current position of the view during an animation. (Android, iPhone, iPad only.) read-only |
| autoLink | Number |
Automatically convert text within this area to clickable links. (iPhone, iPad only.) |
| autocapitalization | Number |
Specifies how text should be capitalized during typing. (Android, iPhone, iPad only.) |
| backgroundColor | String |
Background color of the view. |
| backgroundDisabledColor | String |
Disabled background color of the view. (Android only.) |
| backgroundDisabledImage | String |
Disabled background image for the view, specified as a local file path or URL. (Android only.) |
| backgroundFocusedColor | String |
Focused background color of the view. (Android only.) |
| backgroundFocusedImage | String |
Focused background image for the view, specified as a local file path or URL. (Android only.) |
| backgroundGradient | Gradient |
A background gradient for the view. (iPhone, iPad, Mobile Web only.) |
| backgroundImage | String |
Background image for the view, specified as a local file path or URL. |
| backgroundLeftCap | Number |
Size of the left end cap. (iPhone, iPad only.) |
| backgroundSelectedColor | String |
Selected background color of the view. (Android, Mobile Web only.) |
| backgroundSelectedImage | String |
Selected background image url for the view, specified as a local file path or URL. (Android, Mobile Web only.) |
| backgroundTopCap | Number |
Size of the top end cap. (iPhone, iPad only.) |
| borderColor | String |
Border color of the view. |
| borderRadius | Number |
Border radius of the view. |
| borderWidth | Number |
Border width of the view. |
| bottom | Number or String |
View's bottom position, in platform-specific units. |
| center | Point |
View's center position, in the parent view's coordinates. |
| editable | Boolean |
Is the text area editable? |
| enabled | Boolean |
Is the text area enabled? |
| focusable | Boolean |
Whether view should be focusable while navigating with the trackball. (Android only.) |
| height | Number or String |
View height, in platform-specific units. |
| keepScreenOn | Boolean |
Whether to keep the device screen on. (Android only.) |
| keyboardToolbar | Array<Object> |
Array of toolbar button objects to be used when the keyboard is displayed. (iPhone, iPad only.) |
| keyboardToolbarColor | String |
Color of the keyboard toolbar. (iPhone, iPad only.) |
| keyboardToolbarHeight | Number |
Height of the keyboard toolbar. (iPhone, iPad only.) |
| layout | String |
Specifies how the view positions its children. One of: 'absolute', 'vertical', or 'horizontal'. |
| left | Number or String |
View's left position, in platform-specific units. |
| opacity | Number |
Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). |
| right | Number or String |
View's right position, in platform-specific units. |
| scrollable | Boolean |
Can the text area be scrolled? (iPhone, iPad only.) |
| size | Object |
Size of the view as a dictionary of width and height properties. |
| softKeyboardOnFocus | Number |
Determines keyboard behavior when this view is focused. (Android only.) |
| suppressReturn | Boolean |
Should the return key be suppressed during entry? |
| textAlign | String or Number |
Text alignment, specified using one of the |
| top | Number or String |
The view's top position. |
| touchEnabled | Boolean |
Whether view should receive touch events. |
| transform | Object |
Transformation matrix to apply to the view. (Android, iPhone, iPad only.) |
| value | String |
Value of the text area. |
| visible | Boolean |
Boolean value indicating whether the view is visible. |
| width | Number or String |
View's width, in platform-specific units. |
| zIndex | Number |
the z index position relative to other sibling views |
| Name | Summary |
|---|---|
| blur |
Fired when the text area loses focus. |
| change |
Fired when the text area value changes. |
| click |
Fired when the device detects a click against the view. |
| dblclick |
Fired when the device detects a double click against the view. |
| doubletap |
Fired when the device detects a double tap against the view. (Android, iPhone, iPad only.) |
| focus |
Fired when the text area gains focus. |
| longclick |
Fired when the device detects a long click. (Android only.) |
| longpress |
Fired when the device detects a long press. (Android, iPhone, iPad only.) |
| pinch |
Fired when the device detects a pinch gesture. |
| return |
Fired when the return key is pressed on the keyboard. |
| selected |
Fired when text in the text area is selected. |
| singletap |
Fired when the device detects a single tap against the view. |
| swipe |
Fired when the device detects a swipe gesture (left or right) against the view. (iPhone, iPad, Mobile Web only.) |
| touchcancel |
Fired when a touch event is interrupted by the device. |
| touchend |
Fired when a touch event is completed. |
| touchmove |
Fired as soon as the device detects movement of a touch. |
| touchstart |
Fired as soon as the device detects a touch gesture. |
| twofingertap |
Fired when the device detects a two-finger tap against the view. |