Uploaded image for project: 'Appcelerator - INBOX'
  1. Appcelerator - INBOX
  2. AC-2341

iOS: ListView items (rows) don't autosize (height) correctly (parity)

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Duplicate
    • Affects Version/s: None
    • Component/s: Titanium SDK & CLI
    • Environment:
      • iOS
      • iPhone simlulator
      • Android 2.2 emulator
      • Titanium Mobile SDK 3.1.1.GA
      • Titanium Studio 3.1.0...

      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.

      app.js

      Ti.UI.createWindow({
              backgroundColor:'#fff',
              url:'win1.js',
              layout:'vertical',
              exitOnClose:true,
              navBarHidden:true,
              backgroundColor:'black'
           }).open();
      

      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();
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mpmiranda Mauro Parra-Miranda
                Reporter:
                bitshftr Shawn Lipscomb
              • Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Git Integration