Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-50] API - Titanium.UI.createSwitch (Android)

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2014-08-01T16:39:37.000+0000
Affected Version/sn/a
Fix Version/sRelease 0.6.0
ComponentsAndroid
Labelsandroid
ReporterDon Thorp
AssigneeDon Thorp
Created2011-04-15T02:23:04.000+0000
Updated2014-08-01T16:42:56.000+0000

Description

.h3 Description The purpose of this API is to create a switch native control. (copied from iPhone ticket) .h3 Example
var switch = Titanium.UI.createSwitch({id:'foo', value:true});
switch.addEventListener('change',function(e)
{
    e.value // current value of switch (true or false)
});
.h3 API Arguments * id: optional. HTML element id for where the switch will be placed if placed in webview * value: the initial value. default is true. * color: optional. text color * backgroundColor: optional. background color of field

Comments

  1. Don Thorp 2011-04-15

    (from [ea80588331816c98e1883ee83cf1c941db0602ff]) Toggle button [#50] Native toggle button/switch created using Titanium.UI.createSwitch http://github.com/appcelerator/titanium_mobile/commit/ea80588331816c98e1883ee83cf1c941db0602ff"> http://github.com/appcelerator/titanium_mobile/commit/ea80588331816...

  2. Don Thorp 2011-04-15

    (from [d7bdc2fa16ce5399a92fc2a6886f6fbdf065559d]) [#50 state:resolved] added color and backgroundColor. backgroundColor should probably not be used. http://github.com/appcelerator/titanium_mobile/commit/d7bdc2fa16ce5399a92fc2a6886f6fbdf065559d"> http://github.com/appcelerator/titanium_mobile/commit/d7bdc2fa16ce5...

JSON Source