I am working on application with chat screen. But as normal screen it starts scrolling from top to bottom. But its should be from bottom to top. The application is in Telerik Nativescript platform.
View.xml
<ScrollView row="0" col="0">
<StackLayout class="history-content-area">
<Repeater items="{{messageHistory}}">
<Repeater.itemTemplate>
<StackLayout>
<!-- ITEMS GO HERE -->
</StackLayout>
</Repeater.itemTemplate>
</Repeater>
</StackLayout>
</ScrollView>
I need help in above code how can i scroll to bottom automatically on page load ? Let me know if you need javascript code.
Thanks in advance.
Let's say your ScrollView has its id to 'id-scroller'. Then in your View.js you do:
On your ScrollView you can use scrollToVerticalOffset where you can pass the offset to scroll to.
For example: view.xml
view.js