Titanium JIRA Archive
Appcelerator Community (AC)

[AC-3088] iOS: Switch is not show on the screen if its "value" property is not set

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2012-08-01T13:59:07.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterIvan Skugor
AssigneeAnirudh Nagesh
Created2012-07-31T07:28:27.000+0000
Updated2016-03-08T07:48:08.000+0000

Description

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 }));

Comments

  1. Anirudh Nagesh 2012-08-01

    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
  2. Ivan Skugor 2012-08-02

    Can it be set to "false" by default (because of parity with other platforms)?
  3. Anirudh Nagesh 2012-08-02

  4. Ivan Skugor 2012-08-03

    OK, thanks.
  5. Shak Hossain 2013-12-28

JSON Source