Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

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

$
0
0

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 = newUIView(newCGRect(0, 0, View.Bounds.Width, 200));
backgroundStatusLabel = newUILabel(newCGRect(0, 0, View.Bounds.Width, 100));
backgroundStatusLabel.TextColor = newUIColor(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:

publicoverridevoidDidPull(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


Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>