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

Android: ListView no longer applying default row height

    Details

    • Story Points:
      3
    • Sprint:
      2019 Sprint 2

      Description

      Summary:
      ListView rows are supposed to have a default height if the template doesn't have one. On Android, the default height used to be 45dp (assigned here). As of Titanium 8.0.0, the default height is no longer being applied and the rows are auto-sizing to fit the height of the row's contents instead.

      Steps to reproduce:

      1. Build and run the below code on Android.
      2. Notice that the rows just-fit the height of the row text. (This is the problem.)

      function createListViewSectionItems() {
      	var items = [];
      	for (var index = 1; index <= 100; index++) {
      		items.push({ properties: { title: "Row " + index } });
      	}
      	return items;
      }
       
      var window = Ti.UI.createWindow();
      window.add(Ti.UI.createListView({
      	sections: [Ti.UI.createListSection({
      		headerTitle: "ListView",
      		items: createListViewSectionItems(),
      	})],
      }));
      window.open();
      

      Result:

      Expected Result:
      This is how it used to work in Titanium 7.x.x.

      Note:
      We can't solve this issue by setting a min height to the row's root layout. While that would work, Titanium app developers have spoken out in the past that they don't want this behavior as can be seen in TIMOB-19812. We removed the min height as of Titanium 6.0.0 and we need to keep this behavior. But it's okay to apply a default height if one was not specified.

        Attachments

          Activity

            People

            • Assignee:
              gmathews Gary Mathews
              Reporter:
              jquick Joshua Quick
              Reviewer:
              Joshua Quick
              Tester:
              Keerthi Mahalingam (Inactive)
            • Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code