Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18054] iOS: expose the text color for the picker

GitHub Issuen/a
TypeNew Feature
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2016-04-22T15:34:58.000+0000
Affected Version/sRelease 3.4.1
Fix Version/sRelease 5.4.0
ComponentsiOS
LabelsTCSupportTriage, android, qe-5.4.0, tss
ReporterRene Pot
AssigneeSrikanth Sombhatla
Created2014-11-19T00:30:59.000+0000
Updated2016-06-10T21:57:43.000+0000

Description

Problem Description

I'm not able to set the text color of the picker value. Therefore, I have to use the Android theme files to set it, but this should be exposed in the API as the default color: '#hex' We have tested this issue. But Android, iOS have not text color property of pickerView or pickerRow.

Steps to Reproduce:

1. Create classic project. 3. Paste this code in app.js file. 3. Run this code with the testing environment. 4.
Ti.UI.backgroundColor = 'white';
var win = Ti.UI.createWindow({
    exitOnClose : true,
    layout : 'vertical'
});
 
var picker = Ti.UI.createPicker({
    top : 50
});
 
var data = [];
data[0] = Ti.UI.createPickerRow({
    title : 'Bananas',
    color:'red'
});
data[1] = Ti.UI.createPickerRow({
    title : 'Strawberries'
});
data[2] = Ti.UI.createPickerRow({
    title : 'Mangos'
});
data[3] = Ti.UI.createPickerRow({
    title : 'Grapes'
});
 
picker.add(data);
picker.selectionIndicator = true;
 
win.add(picker);
win.open();

Comments

  1. Ygor Lemos 2015-03-12

    Please do this! It is very annoying, specially when you need more than one picker theme.
  2. Hans Knöchel 2016-02-09

    You can set the color by using a label that is added to a Ti.UI.PickerRow. TIMOB-8632 also makes it possible to tint time- and datetime-pickers. [~topener] can you verify?
  3. Srikanth Sombhatla 2016-04-22

    PR for iOS+Android: https://github.com/appcelerator/titanium_mobile/pull/7960 Use the following app.js for testing
       Ti.UI.backgroundColor = 'white';
       var win = Ti.UI.createWindow({
           exitOnClose : true,
           layout : 'vertical'
       });
        
       var picker = Ti.UI.createPicker({
           top : 50
       });
       
       var data = [];
       data[0] = Ti.UI.createPickerRow({
           title : 'Red',
           color:'red'
       });
       data[1] = Ti.UI.createPickerRow({
           title : 'Green',
           color:'green'
       });
       data[2] = Ti.UI.createPickerRow({
           title : 'Blue',
           color: 'blue'
       });
       data[3] = Ti.UI.createPickerRow({
           title : 'Default'
       });
        
       picker.add(data);
       picker.selectionIndicator = true;
        
       win.add(picker);
       win.open(); 
       
  4. Harry Bryant 2016-06-10

    Verified as fixed, text color property for the picker is now supported on iOS. The same code works correctly with Android. Tested On: iPhone 6S (9.3.2) Device & iPhone 6 Plus (8.3) Device Android Nexus 5 (6.0.1) Device Mac OSX El Capitan 10.11.5 Ti SDK: 5.4.0.v20160608165242 Appc Studio: 4.6.0.201605201934 Appc NPM: 4.2.7-2 App CLI: 5.4.0-15 Xcode 7.3 Node v4.2.6 *Closing ticket.*

JSON Source