This question is locked. New answers and comments are not allowed.
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