[TIMOB-11567] Android : Setting width of picker does not work as expected when useSpinner property is set to true
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-05-21T07:44:30.000+0000 |
Affected Version/s | Release 2.1.3, Release 3.1.0 |
Fix Version/s | 2013 Sprint 12 API, 2013 Sprint 12, Release 3.2.0 |
Components | Android |
Labels | exalture, module_picker, parity, qe-testadded |
Reporter | Anirudh Nagesh |
Assignee | Sunila |
Created | 2012-10-24T18:35:48.000+0000 |
Updated | 2014-06-19T12:43:17.000+0000 |
Description
Run the below code snippet to the issue.
When 'useSpinner' is not used, changing width has the appropriate effect on the picker width.
Ti.UI.backgroundColor = 'black';
var win = Ti.UI.createWindow({
exitOnClose: true,
layout: 'vertical'
});
var picker = Ti.UI.createPicker({
top:50,
useSpinner:'true', //Comment this line to see width having effect. Works fine on iOS
width:'75%', // Also, Ti.UI.FILL should fill up the screen. Does not work as expected on Android
});
var data = [];
data[0]=Ti.UI.createPickerRow({title:'Bananas',width:"80%"});
data[1]=Ti.UI.createPickerRow({title:'Strawberries',width:"80%"});
data[2]=Ti.UI.createPickerRow({title:'Mangos',width:"80%"});
data[3]=Ti.UI.createPickerRow({title:'Grapes',width:"80%"});
picker.add(data);
picker.selectionIndicator = true;
win.add(picker);
win.open();
// must be after picker has been displayed
picker.setSelectedRow(0, 2, false); // select Mangos
Works as expected on iOS.
Issue reproduces with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 (03/11/13 15:43 0c88429) Titanium SDK version: 3.0.2 (02/07/13 16:46 a4def81) Device: Samsung galaxy s duos Android version: 4.0.4
Set the default width property for the columnProxy to be FILL to occupy the entire parent width. https://github.com/appcelerator/titanium_mobile/pull/4300
Verified fixed. TiSDK 3.2.0.v20131017152001 CLI 3.2.0 Titanium Studio 3.2.0.201310152326 Closing.