Titanium JIRA Archive
Appcelerator Community (AC)

[AC-3431] Picker and Picker Row broken on android, picker row shows [Picker Row]

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2016-04-05T15:12:54.000+0000
Affected Version/sAppcelerator Studio 4.5.0
Fix Version/sn/a
ComponentsAlloy, Titanium SDK & CLI
Labelsandroid, picker, pickerrow, ui, ui.picker, ui.pickerrow
ReporterGabriel Mario Aguirre
AssigneeShak Hossain
Created2016-03-30T23:45:36.000+0000
Updated2016-04-05T15:23:14.000+0000

Description

The Picker and Picker row on android is broken. When adding a Label to a row, the displayed data in the Picker Rows is simply [Picker Row]. This works as expected on iOS. - in example.js: var data = []; for(var i = 0; i < theData.length; i++){ var _label = Ti.UI.createLabel({id:'label', font:{fontSize:20,fontWeight:'bold'}, text: theData[i].text, textAlign:'left'}); var _row = Ti.UI.createPickerRow(); _row.add(_label); data.push(row); } $.picker.add(data); data.push(_row);

Attachments

FileDateSize
Screen Shot 2016-03-30 at 4.25.33 PM.png2016-03-30T23:25:53.000+0000135624

Comments

  1. Nazmus Salahin 2016-03-31

    Hello, I have tested this issue. According to the documentation "Views added to picker rows is only supported on iOS." So "custom view for rows" is not supposed to work on android. I've tested the following code in a classic project and found that on android when adding a Label to a row, the displayed data in the Picker Rows is simply "Picker Row". But on iOS "custom view for row" works as expected. According to documentation this is expected behavior not a bug. [Documentation Link](http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.PickerRow) [Android Screenshot Link](http://s18.postimg.org/bzp03k3fd/image.png) [iOS Screenshot Link| http://s12.postimg.org/rxsnwswhp/ios.png] *Code:*
       Ti.UI.backgroundColor = 'white';
       var win = Ti.UI.createWindow({
         exitOnClose: true,
         layout: 'vertical'
       });
       
       var fruit = [ 'Bananas', 'Strawberries', 'Mangos', 'Grapes' ];
       var color = [ 'red', 'green', 'blue', 'orange' ];
       
       for(var i=0, ilen=fruit.length; i<ilen; i++){
         var row = Ti.UI.createPickerRow();
       
         var label = Ti.UI.createLabel({
           color:'red',
           font:{fontSize:20,fontWeight:'bold'},
           text: fruit[i],
           textAlign:'left',
           width:'126'
         });
       
         row.add(label);
         
       }
       
       var picker = Titanium.UI.createPicker();
       
       picker.add(row);
       
       win.add(picker);
       
       win.open();
       
    *Environment*: *Device info:* Nexux7 (android 6.0.1), Simulator - iPhone 6/ iOS 9.2 *Node.js Version:* 0.12.7 *npm Version:* 2.11.3 *Titanium SDKs:* 5.2.0.GA, 5.2.1.GA and 5.2.1.GA *Java Development Kit Version:* 1.8.0_73 *Titanium CLI Version:* 5.0.5 *Appcelerator CLI Version:* 5.2.0 *Appcelerator Studio:* 4.4.0.201511241829
  2. Gabriel Mario Aguirre 2016-04-05

    You know, this is the third ticket I have brought to your guys attention. I realize now that this is an SDK limitation, but I am finally out of reasons to use this software. I will be switching my platform immediately.

JSON Source