[TIMOB-20464] iOS: Picker does not accept percent as height/width
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | High |
| Status | Closed |
| Resolution | Won't Fix |
| Resolution Date | 2016-06-09T23:30:45.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 5.4.0 |
| Components | iOS |
| Labels | AL-5.4.0, picker, qe-5.2.0 |
| Reporter | Josh Longton |
| Assignee | Angel Petkov |
| Created | 2016-02-25T19:08:25.000+0000 |
| Updated | 2016-06-14T16:56:09.000+0000 |
Description
Picker does not accept percent as height/width it needs pixels.
http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Picker-property-height
*Steps to reproduce:*
Add a picker to a view and set the height/width as a percentage or use the app.js below
*Actual :*
The picker does not use the percentage as the height/width.
!Screen Shot 2016-02-25 at 9.21.27 AM.png|thumbnail!
*Expected:*
The Picker should either accept height/width as a percentage or scaling the picker should use pixels
!Screen Shot 2016-02-25 at 9.19.35 AM.png|thumbnail!
*App.js*
Ti.UI.backgroundColor = 'white';
var win = Ti.UI.createWindow({
exitOnClose: true,
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),
top:50,
height:"100%",
width:"100%"
});
win.add(picker);
win.open();
picker.addEventListener('change',function(e){
Ti.API.info("User selected date: " + e.value.toLocaleString());
});
Attachments
| File | Date | Size |
|---|---|---|
| Screen Shot 2016-02-25 at 9.19.35 AM.png | 2016-02-25T17:21:59.000+0000 | 63126 |
| Screen Shot 2016-02-25 at 9.21.27 AM.png | 2016-02-25T17:21:59.000+0000 | 49618 |
Use code provided to test. PR: https://github.com/appcelerator/titanium_mobile/pull/7781/files
var win = Ti.UI.createWindow({ exitOnClose: true, backgroundColor: 'white' }); 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), top:50, height:'100%', width:'100%', backgroundColor:'Blue' }); function postLayout() { console.log('postlayout'); Ti.API.info("Height", picker.getHeight()); Ti.API.info("Width", picker.getWidth()); picker.removeEventListener('postlayout',postLayout); } picker.addEventListener('postlayout',postLayout); win.add(picker); win.open();Closing ticket as "Won't Fix". After discussion with the developers assigned to this ticket, the original fix was causing more issues than it resolved, and was ultimately reverted.