Skip to content

iosEstimatedRowHeight crashes iOS app #1456

Open
@tucazinul

Description

@tucazinul

Hi,

I have two ListViews on different routes, to which I set iosEstimatedRowHeight = 0 and rowHeight = -1. The first time I reach those pages everything works great. The second time however (Page 1 -> Page 2 -> Page 1) it crashes with the message:

ns-list-view: ViewReference not found for item 1. View recycling is not working

On android everything works and also on iOS if i remove the iosEstimatedRowHeight property. But I need that property to avoid scroll issues.

This is how I set the properties in the components:

onListViewLoaded(args): void {
  this.listView = args.object;
  if (isIOS) {
     this.listView.ios.allowsSelection = false;
     this.listView.rowHeight = -1;
     this.listView.iosEstimatedRowHeight = 0;
 }
}

The html it's kinda like this:

<StackLayout height="100%">
  <StackLayout class="body">
        <ListView separatorColor="#fafafc" (loaded)="onListViewLoaded($event)" (loadMoreItems)="loadMoreItems()" [items]="itemsArray" >
          <ng-template let-item="item">
                <Label textWrap="true" class="title" [text]="item.title"></Label>
          </ng-template>
        </ListView>
  </StackLayout>
</StackLayout>

package.json:

"dependencies": {
"@angular/animations": "^5.2.11",
"@angular/common": "^5.2.11",
"@angular/compiler": "^5.2.11",
"@angular/core": "^5.2.11",
"@angular/forms": "^5.2.11",
"@angular/http": "^5.2.11",
"@angular/platform-browser": "^5.2.11",
"@angular/platform-browser-dynamic": "^5.2.11",
"@angular/router": "^5.2.11",
"base-64": "^0.1.0",
"nativescript-angular": "~5.2.0",
"nativescript-cardview": "^2.0.5",
"nativescript-drop-down": "^4.0.0",
"nativescript-feedback": "^1.2.0",
"nativescript-iqkeyboardmanager": "^1.3.0",
"nativescript-ngx-shadow": "^6.0.0",
"nativescript-orientation": "^2.2.0",
"nativescript-platform-css": "^1.6.5",
"nativescript-theme-core": "~1.0.4",
"nativescript-ui-sidedrawer": "^4.1.1",
"nativescript-urlhandler": "^1.2.2",
"nativescript-videoplayer": "^3.1.0",
"nativescript-websockets": "^1.5.0",
"reflect-metadata": "~0.1.8",
"rxjs": "^5.5.11",
"tns-core-modules": "^4.1.0",
"utf8": "^3.0.0",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular/compiler-cli": "^5.2.11",
"@ngtools/webpack": "~1.9.4",
"babel-traverse": "6.26.0",
"babel-types": "6.26.0",
"babylon": "6.18.0",
"copy-webpack-plugin": "~4.3.0",
"css-loader": "^0.28.11",
"extract-text-webpack-plugin": "~3.0.2",
"lazy": "1.0.11",
"nativescript-dev-typescript": "~0.6.0",
"nativescript-dev-webpack": "^0.9.2",
"nativescript-worker-loader": "~0.8.1",
"node-sass": "^4.9.0",
"raw-loader": "~0.5.1",
"resolve-url-loader": "~2.2.1",
"sass-loader": "^7.0.3",
"tns-platform-declarations": "^3.4.1",
"typescript": "~2.6.2",
"uglifyjs-webpack-plugin": "~1.1.6",
"webpack": "~3.10.0",
"webpack-bundle-analyzer": "^2.13.1",
"webpack-sources": "~1.1.0"
}

Please ask for more details, I don't know what else could be useful.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions