[AC-2341] iOS: ListView items (rows) don't autosize (height) correctly (parity)
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2013-07-11T16:35:01.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | defect, ios, listview, parity, titanbeta |
Reporter | Shawn Lipscomb |
Assignee | Mauro Parra-Miranda |
Created | 2013-07-11T13:51:59.000+0000 |
Updated | 2016-03-08T07:41:21.000+0000 |
Description
Problem
ListView items (rows) don't autosize (height) correctly in iOS. They do size correctly on the Android emulator, therefore this is a parity issue.Testcase
Run the following code and notice that the subcaption (the smaller, longer text) doesn't wrap or cause the row to get taller. It does on Android. {panel:title=app.js}
Ti.UI.createWindow({
backgroundColor:'#fff',
url:'win1.js',
layout:'vertical',
exitOnClose:true,
navBarHidden:true,
backgroundColor:'black'
}).open();
{panel}
{panel:title=win1.js}
var win1=Ti.UI.currentWindow;
var ListBoxFont={fontSize:'20dp',fontFamily:'Helvetica Neue'};
var LeftRightChildTemplate={
// we really shouldn't have to specify this size for iOS:
properties:{height:Ti.UI.SIZE}, // DP(70)},
childTemplates:[{type:'Ti.UI.Label',
bindId:'RowTitle',
properties:{ font:ListBoxFont,
textAlign:Ti.UI.TEXT_ALIGNMENT_LEFT,
width:Ti.UI.SIZE,
height:Ti.UI.SIZE,
color:'white',
top:'5dp',
left:'5dp'
}},
{type:'Ti.UI.Label',
bindId:'RowCounter',
properties:{ font:ListBoxFont,
textAlign:Ti.UI.TEXT_ALIGNMENT_LEFT,
width:Ti.UI.SIZE,
height:Ti.UI.SIZE,
color:'white',
top:'5dp',
right:'25dp'
}},
{type:'Ti.UI.Label',
bindId:'SubCaption',
properties:{ font:{fontSize:'13',
fontFamily:'Helvetica Neue'},
textAlign:Ti.UI.TEXT_ALIGNMENT_LEFT,
width:Ti.UI.SIZE,
height:Ti.UI.SIZE,
ellipsize:false,
color:'white',
top:'31dp',
left:'5dp',
right:'55dp',
bottom:'5dp'
}}
]};
var MyListbox=Ti.UI.createListView({
backgroundColor:'black',
templates:{'Template':LeftRightChildTemplate},
defaultItemTemplate:'Template'
});
var SingleSection=Ti.UI.createListSection({headerTitle:'Single Section'});
for (var i=1; (i <= 4); i++)
SingleSection.appendItems([{RowTitle:{text:'Row '+i},
SubCaption:{text:'The quick brown fox jumped over the lazy dogs back.'},
RowCounter:{text:'123'},
properties:{Count:123}}]);
MyListbox.sections=[SingleSection];
win1.add(MyListbox);
win1.open();
{panel}
Attachments
File | Date | Size |
---|---|---|
AndroidListViewTest.png | 2013-07-11T13:51:59.000+0000 | 19608 |
iPhoneListViewTest.png | 2013-07-11T13:51:59.000+0000 | 21211 |
Marking as a duplicate of the linked issue. The issue is one of trying to come up with a general solution that is performant. Would you mind adding your insights onto the linked ticket?
Marking as duplicate of the linked issue.
DUP of TIMOB-13901