We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

SfListView inside SfTabView not displaying all items

Hi,

I have an issue with SfListView inside SfTabView. When there are other items on the content page above the tabView, the list it is displaying will not be scrollable all the way down.

I have found a sample provided by you that should be dealing with a similar issue. I have modified it so that it shows the problem I am experiencing. Basically, I have just added a few labels above the tabView, and now the list does not scroll all the way down. I have tested it in multiple emulators with different versions and resolutions (for example Nexus 5X Api 27). In a higher resolution more items are displayed but, for example, the sample does still not scroll all the way.

You can download my sample project from GitHub repository.

Is this the expected behaviour? In my real project, I am using the top third of the screen to display additional information and buttons, which I would like to follow with the tab view.

Thank you for your help.

5 Replies

JN Jayaleshwari N Syncfusion Team January 22, 2019 09:56 AM UTC

Hi Thomas,  
 
Thanks for contacting Syncfusion Support. 
 
We have checked the reported query “SfListView inside SfTabView not displaying all items while scrolling” from our side. We would like to know that touch didn’t pass to listview item when loaded inside tabview in Android was the issue logged in Tabview control( for version 16.3.0.21) and we have already fixed the reported issue.  
 
We have attached the tested sample which is working fine with latest nuget for your reference and you can download the same from the following location. 
 
Please let us know if you would require further assistance.  
 
Regards,  
Jayaleshwari N  



TO Tomáš Oplatek January 22, 2019 06:51 PM UTC

Hi,

I have downloaded the updated sample, but the issue is still there, this is as far as I can scroll:


The last name should be Josena but I see Lissa. The emulator is Nexus 4 with API 23. It might be specific to some devices/resolutions because in my project the problem does not arise on every device, but with this sample, it happens on every emulator I have tried so far.



SP Subburaj Pandian Veluchamy Syncfusion Team January 23, 2019 09:09 AM UTC

Hi Tomas,  
 
Thank you for the update. 
  
We have checked the reported Scrolling issue with the given sample from our side, we would like to know that in the sample TabView is loaded below many labels in stack layout without any defined size for tabview. So, the ListView items loaded inside the tabview was hidden below the StackLayout. This same issue will occur in Xamarin listview as well. It can be resolved by defining the HeightRequest property for the SfTabview or SfListView to load the items completely in view. We have set HeightRequest property for TabView and modified the sample based on that. Please find the modified sample by the following link.  
  
  
We hope that this helps you, kindly revert us if doesn’t meets your requirement. 
  
Regards,
Subburaj Pandian V  



TO Tomáš Oplatek January 23, 2019 09:26 PM UTC

Hi,

Thank you for your help, I have been able to solve my issue by using HeightRequest and MinimumHeightRequest.

I have one more question, I am trying to implement a solution that would show the position of the item in listview. In this sample, I would like for the names to have a number in front of the names that indicates their position. I have been trying to solve this by using BindingContextChanged and it works, but when I re-order the items by dragging down it does not work properly. Is there an easier way of doing this, maybe some "position" binding that I am missing? Any help would be greatly appreciated.

Thank you.


JN Jayaleshwari N Syncfusion Team January 24, 2019 11:54 AM UTC

Hi Tomas,  
  
Thanks for contacting Syncfusion Support. 
  
We have checked your query to update item position from our side. We would like to know that you can update listview item with position while dragging by updating the ItemPosition with Itemsize of SfListView for each item after dropping with the help of drag item’s position in ItemDraggingEvent. 
  
namespace TabView  
{  
   public class Behavior :Behavior<SfListView>  
    {  
        SfListView ListView;  
        ViewModel ViewModel;  
        protected override void OnAttachedTo(SfListView listView)  
        {  
            ListView = listView;  
            ViewModel = new ViewModel();  
            ViewModel = listView.BindingContext as ViewModel;  
            ListView.ItemDragging += ListView_ItemDragging;  
            ListView.DataSource.LiveDataUpdateMode = Syncfusion.DataSource.LiveDataUpdateMode.AllowDataShaping;  
            base.OnAttachedTo(listView);  
        }  
  
        private async void ListView_ItemDragging(object sender, ItemDraggingEventArgs e)  
        {  
            if (e.Action == DragAction.Drop)  
            {  
                if (e.OldIndex < e.NewIndex)  
                {  
                    await Task.Delay(100);  
                    ChangeData(e);  
                }  
            }  
        }  
  
        private void ChangeData(ItemDraggingEventArgs e)  
        {  
            ViewModel.ToDoList.MoveTo(e.OldIndex, e.NewIndex);  
  
            var position = e.Position.Y;  
            var itemSize = 0;  
            for (int i = 0; i < ViewModel.ToDoList.Count; i++)  
            {  
                (ViewModel.ToDoList[i] as ToDoItem).OrderPosition = position + itemSize;  
                itemSize += 60;  
            }  
        }  
  
    }  
}  
   
We have attached the sample for your reference and you can download the same from the following location. 
 
Please let us know, if this solution meets your requirement. 
  
Regards,  
Jayaleshwari N 


Loader.
Live Chat Icon For mobile
Up arrow icon