Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2341] iOS: ListView items (rows) don't autosize (height) correctly (parity)

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionDuplicate
Resolution Date2013-07-11T16:35:01.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsdefect, ios, listview, parity, titanbeta
ReporterShawn Lipscomb
AssigneeMauro Parra-Miranda
Created2013-07-11T13:51:59.000+0000
Updated2016-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

FileDateSize
AndroidListViewTest.png2013-07-11T13:51:59.000+000019608
iPhoneListViewTest.png2013-07-11T13:51:59.000+000021211

Comments

  1. Ingo Muschenetz 2013-07-11

    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?
  2. Ingo Muschenetz 2013-07-11

    Marking as duplicate of the linked issue.
  3. Mauro Parra-Miranda 2013-11-24

    DUP of TIMOB-13901

JSON Source