Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-19525

iOS: ListView/TableView in a container with "vertical" layout is cut off

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Invalid
    • Affects Version/s: Release 4.1.1
    • Fix Version/s: None
    • Component/s: iOS
    • Environment:

      iOS simulators and devices, SDK 3.5.0.GA (exists since at least 3.3.0)

      Description

      Run the code below. You will see the ListView and TableView get cut short by exactly the offset in the vertical layout (e.g. if the ListView is specified with top:20 then 20 points will be cut off at its bottom).

      var win1 = Ti.UI.createWindow({
          backgroundColor : 'white',
          layout: 'vertical' // causes the bug
      });
       
      var label1 = Ti.UI.createLabel({top: 0, text: 'Do you see 20 tableview rows?', font: {fontSize: '16dp'}, height: 50, color: 'black'});
      win1.add(label1);
      var tableData = [];
      for (var i = 1; i <= 20; i++) {
      	tableData.push({title: 'table row' + i});
      }
       
      // The tableview will be cut at the bottom by 100 points
      var table = Ti.UI.createTableView({ data: tableData, top: 100});
      win1.add(table);
       
       
      var win2 = Ti.UI.createWindow({
          backgroundColor : 'white',
          layout: 'vertical' // causes the bug
      });
      var label2 = Ti.UI.createLabel({top: 0, text: 'Do you see 20 listview rows?', font: {fontSize: '16dp'}, height: 50, color: 'black'});
      win2.add(label2);
      // the listview will be cut by 100 points
      var listView = Ti.UI.createListView({top: '100dp'});
      var section = Ti.UI.createListSection(); 
      var sections = [];
      var data = [];
       
      for (var i = 1; i <= 20; i++) {
      	data.push({properties : {title : 'listview row ' + i}});
      }
      section.setItems(data);
      sections.push(section);
      listView.sections = sections;
       
      win2.add(listView);
       
      var win3 = Ti.UI.createWindow({
          backgroundColor : 'white',
          layout: 'absolute' // OK
      });
       
      var label3 = Ti.UI.createLabel({top: 0, text: 'Absolute layout so we see 20 rows', font: {fontSize: '16dp'}, height: 50, color: 'black'});
      win3.add(label3);
      var tableData3 = [];
      for (var i = 1; i <= 20; i++) {
      	tableData3.push({title: 'table row' + i});
      }
      // since in absolute layout, this tableview will look OK
      var table3 = Ti.UI.createTableView({ data: tableData3, top: 100});
      win3.add(table3);
       
      var tab1 = Ti.UI.createTab({title: 'BUG1', window: win1});
      var tab2 = Ti.UI.createTab({title: 'BUG2', window: win2});
      var tab3 = Ti.UI.createTab({title: 'OK', window: win3});
      var tabgroup = Ti.UI.createTabGroup({tabs: [tab1, tab2, tab3]});
      tabgroup.open();
      

        Attachments

          Activity

            People

            • Assignee:
              emerriman Eric Merriman
              Reporter:
              mokesmokes Mark Mokryn
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-20355
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code