I am developing a chat app, when list loaded and when a new item added to list I need to scroll to bottom of list. I can do that with this.
scrollToBottom() {
let lv = <ListView>frame.topmost().getViewById('messageList');
lv.scrollToIndex(this.store.items.getValue().length - 1)
}
But it showing bottom of list instant
There is a guide to do that on IOS but not on Android
private srollListView(position: number) {
if (this._listView.ios) {
this._listView.ios.scrollToRowAtIndexPathAtScrollPositionAnimated(
NSIndexPath.indexPathForItemInSection(position, 0),
UITableViewScrollPosition.UITableViewScrollPositionTop,
true
);
}
else {
this._listView.scrollToIndex(position);
}
}
link to guide: http://nuvious.com/Blog/2016/4/4/how-to-make-the-nativescript-listview-scrolltoindex-animated-on-ios
Is there any way to do that on Android?