The problem
Switch control in not shown on the screen unless its "value" property is not set to some value.
Test case
To see the issue, run this example:
(function() {
var win = Ti.UI.createWindow({
navBarHidden: true,
backgroundColor: '#000'
});
win.add(Ti.UI.createSwitch());
win.open();
})();
Switch shouldn't be present on the screen.
Expected behaviour
Switch should be show on the screen even without a need to set "value" property to some value.
Workaround
Set "value" property to some initial value: win.add(Ti.UI.createSwitch({ value: false }));
It is a mandatory property for iOS. its also mentioned in the docs. http://docs.appcelerator.com/titanium/2.1/index.html#!/api/Titanium.UI.Switch
Can it be set to "false" by default (because of parity with other platforms)?
OK, thanks.