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

iOS: ListView: Cannot set dynamic height on ItemTemplate (Ti.UI.SIZE)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Release 3.1.0, Release 3.2.0
    • Component/s: iOS
    • Labels:
      None
    • Environment:

      Ti SDK 3.1 GA, 3.2 CI
      iOS 6

      Description

      Problem
      Cannot set height of listView row to Ti.UI.SIZE, it must be a fixed height. This prevents the use of dynamic length text inside the rows without truncating the text.

      Test case

      var win = Ti.UI.createWindow({
      	backgroundColor : 'white'
      });
       
      var myTemplate = {
      	childTemplates : [{
      		type : 'Ti.UI.Label',
      		bindId : 'textLabel',
      		properties : {
      			color : '#000'
      		}
      	}],
      	properties : {
      		//height : '150dp',
      		height : Ti.UI.SIZE
      	}
      }
       
      var listView = Ti.UI.createListView({
      	templates : {
      		'template' : myTemplate
      	},
      	defaultItemTemplate : 'template'
      });
      var sections = [];
       
      var dataSection = Ti.UI.createListSection({
      	headerTitle : 'Data'
      });
      sections.push(dataSection);
       
      var items = [{
      	textLabel : {
      		text : 'This is really long text! Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque molestie sollicitudin dolor quis eleifend. Maecenas ultricies sodales venenatis. Maecenas molestie purus eget sem dignissim sed tempus arcu sagittis. Aenean metus lorem, facilisis a dignissim a, tempus quis enim.'
      	}
      }, {
      	textLabel : {
      		text : 'This is really long text! Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque molestie sollicitudin dolor quis eleifend. Maecenas ultricies sodales venenatis. Maecenas molestie purus eget sem dignissim sed tempus arcu sagittis. Aenean metus lorem, facilisis a dignissim a, tempus quis enim.'
      	}
      }, {
      	textLabel : {
      		text : 'This is really long text! Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque molestie sollicitudin dolor quis eleifend. Maecenas ultricies sodales venenatis. Maecenas molestie purus eget sem dignissim sed tempus arcu sagittis. Aenean metus lorem, facilisis a dignissim a, tempus quis enim.'
      	}
      }, {
      	textLabel : {
      		text : 'This is really long text! Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque molestie sollicitudin dolor quis eleifend. Maecenas ultricies sodales venenatis. Maecenas molestie purus eget sem dignissim sed tempus arcu sagittis. Aenean metus lorem, facilisis a dignissim a, tempus quis enim.'
      	}
      }]
      dataSection.setItems(items);
       
      listView.sections = sections;
      win.add(listView);
      win.open();
      

      Workaround
      See Community Discussion link.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vduggal Vishal Duggal (Inactive)
                Reporter:
                samci Sam Schechter
                Reviewer:
                Pedro Enrique (Inactive)
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Integration