[TIMOB-16938] iOS: Font property doesn't work for Picker and PickerColumn
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-11-17T22:04:43.000+0000 |
Affected Version/s | Release 3.3.0 |
Fix Version/s | Release 4.0.0 |
Components | iOS |
Labels | parity, qe-3.3.0, qe-testadded |
Reporter | Priya Agarwal |
Assignee | Chee Kiat Ng |
Created | 2014-05-09T06:16:35.000+0000 |
Updated | 2015-01-26T21:36:58.000+0000 |
Description
Steps to reproduce:
1. Copy Paste the code in app.js and run the app on iOS device.
Expected Result:
1. Must observe the difference in font size than normal.
Actual Result:
1. No differences appear. Font Size appears the same.
Working fine for Android. See the issue TIMOB-14007
var win = Ti.UI.createWindow({
backgroundColor: 'white',
exitOnClose: true,
fullscreen: false,
title: 'Use picker to make selection'
});
var fruit = [ 'Bananas', 'Grapes', 'Blueberries', 'Strawberries' ];
var color = [ 'blue', 'red', 'yellow', 'white' ];
var column1 = Ti.UI.createPickerColumn({font: {fontSize: 40}});
for(var i=0, ilen=fruit.length; i<ilen; i++){
var row = Ti.UI.createPickerRow({
title: fruit[i]
});
column1.addRow(row);
}
var column2 = Ti.UI.createPickerColumn();
for(var i=0, ilen=color.length; i<ilen; i++){
var row = Ti.UI.createPickerRow({
title: color[i]
});
column2.addRow(row);
}
var picker = Ti.UI.createPicker({
columns: [column1, column2],
selectionIndicator: true,
useSpinner: true, // required in order to use multi-column pickers with Android
top:50
});
function pickerDefaults(obj){
// on iOS, must be after picker has been rendered
picker.setSelectedRow(0, 2, false);
picker.setSelectedRow(1, 3, false);
}
win.add(picker);
win.open();
Test case for Date Picker:
Ti.UI.backgroundColor = 'white';
var win = Ti.UI.createWindow({
layout: 'vertical'
});
var picker = Ti.UI.createPicker({
type:Ti.UI.PICKER_TYPE_DATE,
minDate:new Date(2009,0,1),
maxDate:new Date(2014,11,31),
value:new Date(2014,3,12),
font: {fontSize: 40},
top:50,
useSpinner: true
});
win.add(picker);
win.open();
3.4.0 is moved forward, and 3.5.0 is taking its place in the calendar.
For iOS, font property cannot be implemented for Date Pickers. It can only be done on picker of type Titanium.UI.PICKER_TYPE_PLAIN, and specifically in PickerRow. PR here: https://github.com/appcelerator/titanium_mobile/pull/6330 Above PR plus formatting fix: https://github.com/appcelerator/titanium_mobile/pull/6361
Edited test case:
Verified fix on: Mac OSX 10.10.1 Appcelerator Studio, build: 3.4.1.201410281743 Titanium SDK build: 3.6.0.v20150122144134 Titanium CLI, build: 3.4.1 Alloy: 1.5.1 Xcode 6.1.1 iPhone 6 (8.1), iPad Air 2 (8.2b4) Using the provided code built to both devices, font property can now be set. Closing ticket.