Skip to content

[iOS only] Child Layouts of items in ListView are displayed on top of each other when height vary #6594

@mmeven

Description

@mmeven

Environment

  • CLI: 5.0.0-2018-10-15-12485
  • Cross-platform modules: 5.2.0-2018-11-19-184627-02
  • Android Runtime: 5.0.0
  • iOS Runtime: 5.1.0-2018-11-19-091441-01

Describe the bug
The issue is caused when a child layout of an ng-template can have a different height depending of the item displayed. It results in layouts being displayed on top of each other for items not at the top of the list (not displayed before scrolling), even though the parent layout has set its size to be able to contain every child layout.

To Reproduce

Create a component containing a ListView. The template for the items must be made of a parent Layout, and several child Layouts (at least 2) with one having a varying height, with a Label that is not displayed every time for exemple.

Expected behavior
The child Layouts should be displayed like this :
screenshotok

What happens
But this is what happens :
screenshotnotok

Sample project
https://github.com/mmeven/nativescript-listview-issue

Additional context

I did not manage to reproduce this issue with versions before 5.0.0, with tns-core-modules 4.2.1 and tns-ios 4.2.0 it works just fine. The "expected behavior" screenshot was done using those previous versions.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions