javascript - Auto scroll to Bottom -


i working on application chat screen. normal screen starts scrolling top bottom. should bottom top. application 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 in above code how can scroll bottom automatically on page load ? let me know if need javascript code.

thanks in advance.

on scrollview can use scrolltoverticaloffset can pass offset scroll to.

for example: view.xml

<scrollview row="0" col="0" id="myscroller">       <stacklayout class="history-content-area">         <repeater items="{{messagehistory}}">             <repeater.itemtemplate>                 <stacklayout>                     <!-- items go here -->                 </stacklayout>             </repeater.itemtemplate>         </repeater>     </stacklayout> </scrollview> 

view.js

mscroller = page.getviewbyid("myscroller");  var offset = mscroller.scrollableheight; // current scroll height mscroller.scrolltoverticaloffset(offset, false); // scroll bottom 

Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -