RadListView Android ScrollPosition

Thread is closed for posting
5 posts, 0 answers
  1. Ericky
    Ericky avatar
    49 posts
    Member since:
    Jun 2017

    Posted 20 Jun 2017 Link to this post

    Is it possible to change the scrollPosition for android?

    I've seen the scrollPosition property is iOS only and I would like for my list to aways scroll items to the top first.

  2. Nikolay Iliev
    Admin
    Nikolay Iliev avatar
    351 posts

    Posted 21 Jun 2017 Link to this post

    Hello Ericky,

    At this moment the scrollToPosition is only supported by the iOS implementation, However, the Android implementation is planned for development and you can track any update on when the feature will be released in this logged issue. For your convenience, I have upvoted the feature request via this ticket.

    Meanwhile, as a temporary solution, you can either use the scrollToIndex method on RadListView or use the private property _android and access the native methods like smoothScrollToPosition. Notice that using the private properties should be treated only as a temporary workaround as any private properties might be removed or modified in future releases.
    Here is how to use a smooth scroll to a position with RadLListView.

    lv = <RadListView>page.getViewById("lv");
    lv._android.smoothScrollToPosition(11); // scroll position shoud not be visible or the list won't scroll

    Full test project demonstrating the techniques can be found here.

    Regards,
    Nikolay Iliev
    Progress Telerik
    Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
  3. Deyan
    Admin
    Deyan avatar
    2147 posts

    Posted 11 Jul 2017 Link to this post

    Hi,

    The discussed feature is now available in RadListView. You can take a look at the online docs for more information about how to use it:

    http://docs.telerik.com/devtools/nativescript-ui/Controls/NativeScript/ListView/scrolling

    Let us know if you have additional feedback.

    Regards,
    Deyan
    Progress Telerik
    Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
  4. Ericky
    Ericky avatar
    49 posts
    Member since:
    Jun 2017

    Posted 11 Jul 2017 in reply to Deyan Link to this post

    Hey Deyan,

     

    I don't see any documentation about this feature for android. The docs say "ScrollPosition" is available for iOS only still.

     

    Thanks.

  5. Nikolay Iliev
    Admin
    Nikolay Iliev avatar
    351 posts

    Posted 12 Jul 2017 Link to this post

    Hello Ericky,

    RadListView now has extended scrolling functionality as documented in this article.
    You can now scroll to a position on Android using the scrollWithAmount method which will work on both Android and iOS.
    e.g.
    var list = page.getViewById("list");
     
    list.scrollWithAmount(250, true);

    With the example above the RadListView will scroll 250dp with animated effect (the boolean flag set to true is to enable the animated scrolling).

    Regards,
    Nikolay Iliev
    Progress Telerik
    Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
Back to Top