This is a migrated thread and some comments may be shown as answers.

RadListView Android ScrollPosition

4 Answers 149 Views
ListView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ericky
Top achievements
Rank 1
Ericky asked on 20 Jun 2017, 10:22 PM

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.

4 Answers, 1 is accepted

Sort by
0
Nick Iliev
Telerik team
answered on 21 Jun 2017, 05:33 AM
Hello ,

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.
0
Deyan
Telerik team
answered on 11 Jul 2017, 07:15 AM
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.
0
Ericky
Top achievements
Rank 1
answered on 11 Jul 2017, 03:56 PM

Hey Deyan,

 

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

 

Thanks.

0
Nick Iliev
Telerik team
answered on 12 Jul 2017, 09:17 AM
Hello ,

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.
Tags
ListView
Asked by
Ericky
Top achievements
Rank 1
Answers by
Nick Iliev
Telerik team
Deyan
Telerik team
Ericky
Top achievements
Rank 1
Share this question
or