Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8249] iOS: Switch - Switch controls do not auto size to fit in view

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionInvalid
Resolution Date2012-03-23T15:09:11.000+0000
Affected Version/sRelease 2.0.0
Fix Version/sn/a
ComponentsiOS
Labelsqe-ios031912, qe-nfc
ReporterWilson Luu
AssigneeNeeraj Gupta
Created2012-03-23T14:29:47.000+0000
Updated2017-03-09T23:05:42.000+0000

Description

Steps to reproduce: 1. Run code on iOS:
// Create a switch on a parent that is width and height constrained  
// See that the switch sizes itself accordingly 

var win = Ti.UI.createWindow();
win.backgroundColor = 'white';

var label = Ti.UI.createLabel({
	text: 'Pass if switches are...',
	top: 20,
	left: 10,
	height: Ti.UI.SIZE,
	width: Ti.UI.SIZE,
	color: 'black'
});

var view1 = Ti.UI.createView({
	height: 30,
	width: 60,
	top: 80,
	backgroundColor: 'green'
});

var sw1=Titanium.UI.createSwitch({
	value: true
});

var view2 = Ti.UI.createView({
	height: 50,
	width: 120,
	top: 140,
	backgroundColor: 'green'
});

var sw2=Titanium.UI.createSwitch({
	value: true,
	title:'Testing'
});

var view3 = Ti.UI.createView({
	height: 70,
	width: 180,
	top: 220,
	backgroundColor: 'green'
});

var sw3=Titanium.UI.createSwitch({
	value: true,
	title: 'Test'
});


view1.add(sw1);
view2.add(sw2);
view3.add(sw3);

win.add(view1);
win.add(view2);
win.add(view3);
win.add(label);

win.open();

Actual: Switch controls do not size to the view. See attachment. Expected: Switch controls should size to the view.

Attachments

FileDateSize
Screenshot 2012.03.23 15.28.02.png2012-03-23T14:29:48.000+000037638

Comments

  1. Vishal Duggal 2012-03-23

    Switch views are SIZE views.
  2. Lee Morris 2017-03-09

    Closing ticket as invalid.

JSON Source