Hi Support:
I have a RadListView inside the ContentPage and the scrolling was behaving fine. But then I added an Activity Indicator that should be displayed above the listview to the page like this:
<StackLayout>
<ActivityIndicator IsRunning="{Binding IsBusy}" IsVisible="{Binding IsBusy}"/>
<telerikDataControls:RadListView x:Name="lv" ....>
.........
</telerikDataControls:RadListView>
</StackLayout>
And now the scrolling is not keeping the new scrolled position. When you release the scroll, the listview returns to the prior position. This is happening in Android and iPhone.
Do I need to add a ScrollView or I am missing something here.
Thanks in advanced.
David
6 Answers, 1 is accepted
Thank you for contacting us.
You should not put a RadListView inside a StackLayout because the size of the list view is not restricted - all elements will be rendered and the listview will not scroll. The only exception is the Android platform where we restrict the size of the control to the size of the screen due to performance issues.
<
Grid
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"Auto"
/>
<
RowDefinition
Height
=
"*"
/>
</
Grid.RowDefinitions
>
<
ActivityIndicator
/>
<
telerikDataControls:RadListView
Grid.Row
=
"1"
/>
</
Grid
>
I hope this helps.
Regards,
Rosy Topchiyska
Telerik by Progress
Hi Rosy:
WIth your approach the scroll works, but the only issue is that tha Activityindicator is leaving a space when is not visible. I tried adding Margin="0" to the tha ActivityIndicator without luck.
Would be possible to remove this empty space, so the RadLisview is in the edge of the toolbar. This is hapening both in iOS and Android.
Thanks
David
The Xamarin.Forms ActivityIndicator is a Xamarin.Forms.VisualElement object, so it has an IsVisible property. You can use the IsVisible property to completely hide/show an element.
For example:
<
ActivityIndicator
IsVisible
=
"False"
/>
You can also bind to IsVisible from a view model, which makes it more convenient in MVVM scenarios:
<
ActivityIndicator
IsVisible
=
"{Binding IsLoadingData}"
/>
Let us know if you have any further questions.
Regards,
Lance | Tech Support Engineer, Sr.
Telerik by Progress
Hi Lance:
I found the problem. The issue was not related with ActivityIndicator.
To fix the issue I added the RowSpacing attribute to 0 for the Grid as follows:
<Grid RowSpacing="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
</Grid>
I would like to turn your attention to the fact that the ActivityIndicator is not part of our suite. You can try looking for a solution in the internet. There many resources available describing how such controls should be used. Also you can ask/search for a question in StackOverflow this is a great resource where many issues are discussed and resolved.
I hope this will help you.
Regards,
Pavel R. Pavlov
Telerik by Progress