[TIMOB-8251] Android: Switch - Switch do not auto size to fit in view
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2012-03-26T13:05:42.000+0000 |
Affected Version/s | Release 2.0.0 |
Fix Version/s | n/a |
Components | Android |
Labels | parity, qe-and031912, qe-nfc |
Reporter | Wilson Luu |
Assignee | Marshall Culpepper |
Created | 2012-03-23T14:37:13.000+0000 |
Updated | 2017-03-09T23:23: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
File | Date | Size |
---|---|---|
device-2012-03-23-153643.png | 2012-03-23T14:37:13.000+0000 | 37299 |
The switch should not size to fit the view as the title of the bug says since it has size behavior. Although I'm not sure whether it's a bug that we don't make the switch big enough to fit the title (looks like this is an android only property).
Android behavior is correct in this use case
Closing ticket as invalid.