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

Scrolling is not persisting the new position inside a StackLayout

6 Answers 279 Views
ListView
This is a migrated thread and some comments may be shown as answers.
FS
Top achievements
Rank 1
FS asked on 08 Dec 2016, 06:39 PM

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

Sort by
0
Rosy Topchiyska
Telerik team
answered on 13 Dec 2016, 02:19 PM
Hi,

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.
 
In your scenario, we recommend using a Grid.
<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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
FS
Top achievements
Rank 1
answered on 15 Dec 2016, 03:54 PM

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

 

0
Lance | Manager Technical Support
Telerik team
answered on 15 Dec 2016, 05:18 PM
Hi 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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
FS
Top achievements
Rank 1
answered on 15 Dec 2016, 07:34 PM

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>

 

 

0
Martin
Top achievements
Rank 1
answered on 03 Feb 2017, 05:30 PM
Im trying to display the element (here activityindicator) in the center of the screen. I'm not able to do that, it always apears on the top. Can you help me?
0
Pavel R. Pavlov
Telerik team
answered on 07 Feb 2017, 12:25 PM
Hello Martin,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
ListView
Asked by
FS
Top achievements
Rank 1
Answers by
Rosy Topchiyska
Telerik team
FS
Top achievements
Rank 1
Lance | Manager Technical Support
Telerik team
Martin
Top achievements
Rank 1
Pavel R. Pavlov
Telerik team
Share this question
or