Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11567] Android : Setting width of picker does not work as expected when useSpinner property is set to true

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-05-21T07:44:30.000+0000
Affected Version/sRelease 2.1.3, Release 3.1.0
Fix Version/s2013 Sprint 12 API, 2013 Sprint 12, Release 3.2.0
ComponentsAndroid
Labelsexalture, module_picker, parity, qe-testadded
ReporterAnirudh Nagesh
AssigneeSunila
Created2012-10-24T18:35:48.000+0000
Updated2014-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.

Comments

  1. jithinpv 2013-03-12

    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
  2. Sunila 2013-05-20

    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
  3. Federico Casali 2013-10-18

    Verified fixed. TiSDK 3.2.0.v20131017152001 CLI 3.2.0 Titanium Studio 3.2.0.201310152326 Closing.

JSON Source