The ListView with PullToRefresh Enabled in Xamarin.Forms 3.5 can't capture the pull-to-refresh gesture in non-data areas.
The SwipeRefreshLayout
only capture that gesture in the area with pink TextCells, but the blank area fails.
Refreshing is activated on all areas of ListView
Blank area can't activate Refresh
Create an Xamarin.Android (XAML UI) project App1
, with
MainPage.xaml
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:App1"
Title="wtf"
x:Class="App1.MainPage">
<ListView x:Name="MyListView"
IsPullToRefreshEnabled="True"
IsRefreshing="{Binding IsBusy, Mode=OneWay}"
ItemsSource="{Binding Sources}"
BackgroundColor="Transparent"
RefreshCommand="{Binding Command}">
<ListView.ItemTemplate>
<DataTemplate>
<TextCell Text="{Binding Val}" />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ContentPage>
MainPage.xaml.cs
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using Xamarin.Forms;
namespace App1
{
public class SrcItem
{
public string Val { get; set; }
}
public partial class MainPage : ContentPage
{
public ObservableCollection<SrcItem> Sources { get; }
public ICommand Command { get; }
public MainPage()
{
InitializeComponent();
Sources = new ObservableCollection<SrcItem>();
Command = new Command(AddData);
Sources.Add(new SrcItem { Val = "gstql!! - " + Sources.Count });
MyListView.BindingContext = this;
}
private void AddData()
{
IsBusy = true;
Sources.Add(new SrcItem { Val = "gstql!! - " + Sources.Count });
IsBusy = false;
}
}
}
In version 3.5.0.169047, this problem remained.
The pull-to-refresh got broken in 3.5.0.129452 and still broken 3.5.0.169047.
I can confirm it has been working in 3.4.0.1029999.
How the situation with a bug is? In progress or in backlog?
I would also be interested in an update on this bug. Thanks!
Interested aswell. Thanks!
Also not fixed in 3.6
And also not fixed in 4.0
Is this fix released? Does it also work when the list view is completely empty?
@ddobrev no, from what I can see it doesn't look to be in any releases yet.
Due to the date of merge, it should be part of XF from 4.0.0.497661
Any news about this? I update to the latest XF version and it still occurs.
If my list view is empty, there is no way to pull to refresh
I had this problem on Android in 4.0.0.497661. Updated to 4.0.0.707238 and the problem was no longer there. Never had a problem with iOS. Can't say anything about any other platforms.