This question is locked. New answers and comments are not allowed.
I found that for RadListView on iOS, when I use scrollToIndex after load on demand action, the display of the list view has strange behaviour.
Steps to reproduce:
- Clone the SDKAngular examples repo (https://github.com/telerik/nativescript-ui-samples-angular.git)
- In the listview load-on-demand sample component (nativescript-ui-samples-angular/sdkAngular/app/listview/load-on-demand/listview-load-on-demand.component.ts), modify the method onLoadMoreItemsRequested() as follows (I changed the number of additional items to load and then call scrollToIndex()):
public onLoadMoreItemsRequested(args: ListViewEventData) { var that = new WeakRef(this); Timer.setTimeout(function () { var listView: RadListView = args.object; var initialNumberOfItems = that.get()._numberOfAddedItems; for (var i = that.get()._numberOfAddedItems; i < initialNumberOfItems + 10; i++) { if (i > posts.names.length - 1) { listView.loadOnDemandMode = ListViewLoadOnDemandMode[ListViewLoadOnDemandMode.None]; break; } var imageUri = applicationModule.android ? posts.images[i].toLowerCase() : posts.images[i]; that.get()._dataItems.push(new DataItem(i, posts.names[i], "This is item description", posts.titles[i], posts.text[i], "res://" + imageUri)); that.get()._numberOfAddedItems++; } listView.notifyLoadOnDemandFinished(); listView.scrollToIndex(4); }, 1000); args.returnValue = true;}- tns run ios
- Go to listview load-on-demand sample, scroll to bottom, and click "Load More"
- The display of the listview will become strange (the message load more is keep showing even the items were loaded). Please see attached screen shot file
- When scroll the listview to bottom and then up, the listview will become normal again
- Tested on Android and no issue found. Only happens on ios.
Kindly advice
Clarence
