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

Initializing an empty list doesn't have pull-to-refresh enabled

1 Answer 164 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.
Eric
Top achievements
Rank 1
Eric asked on 02 Sep 2015, 11:08 AM

Hi,

When I initialize a TKListView in my Xamarin iOS view, I check if there are any items to display. If the list is empty, I'll show a label to the user "no data available":

 

var view = new UIView(new CGRect(0, 0, View.Bounds.Width, 200));
backgroundStatusLabel = new UILabel(new CGRect(0, 0, View.Bounds.Width, 100));
backgroundStatusLabel.TextColor = new UIColor(0.80f, 0.8f, 0.8f, 1);
backgroundStatusLabel.TextAlignment = UITextAlignment.Center;
 
view.Add(backgroundStatusLabel);
 
_listView.BackgroundView = view;

The view renders perfectly. Showing the image as seen in the attachment. But the pull-to-refresh doesn't work. I put a breakpoint in the Delegate, but it doesn't hit the DidPull event:

public override void DidPull(TKListView listView, nfloat offset)
{
    listView.PullToRefreshView.Alpha = (float)Math.Min(offset / listView.PullToRefreshTreshold, 1.0f);
}

But if I:

  • initialize the TKListView with at least 1 item
  • then delete that item from the TKListView
  • Show the 'No Results' message

...then the Pull-to-refresh works and the DidPull is hit by the debugger.

 Can someone point me in the right direction to make this pull to refresh work, even on an empty TKListView?

 

Many thanks in advance

1 Answer, 1 is accepted

Sort by
0
Adrian
Telerik team
answered on 03 Sep 2015, 04:20 PM
Hello Eric,

Thank you for contacting us.

Currently there is an issue with the pull-to-refresh functionality of TKListView when the list view is empty. The issue will be addressed in one of our future releases. You can follow its status in our feedback portal. I also update your Telerik points for reporting this issue.

Should you need further assistance, do not hesitate to contact us.

Regards,
Adrian
Telerik
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
Eric
Top achievements
Rank 1
Answers by
Adrian
Telerik team
Share this question
or