Bug 48376 - iOS Listview Pull-to-refresh ActivityIndicator doesn't show when set active.
Summary: iOS Listview Pull-to-refresh ActivityIndicator doesn't show when set active.
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: 2.3.3
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-11-30 03:32 UTC by danielr
Modified: 2017-11-02 00:03 UTC (History)
4 users (show)

Tags: ac
Is this bug a regression?: No
Last known good build:


Attachments
testcase project with bug (10.05 KB, application/octet-stream)
2016-11-30 03:33 UTC, danielr
Details
test project with hacky workaround (10.25 KB, application/octet-stream)
2016-11-30 04:26 UTC, danielr
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description danielr 2016-11-30 03:32:31 UTC
When the ListView.IsRefreshingProperty is bound to a true, or IsRefreshing is set to true, or ListView.BeginRefresh() is called: The space opens up for the indicator, but the space remains blank.

The indicator only shows when the listview is pulled on by a user.
Comment 1 danielr 2016-11-30 03:33:42 UTC
Created attachment 18712 [details]
testcase project with bug
Comment 2 danielr 2016-11-30 04:09:39 UTC
Extra info
This only happens if the IsRefreshing is set during the construction call.
If I call BeginRefresh() one second after the listview is created, the indicator appears.

This is not a suitable fix for me though, I need to be able to bind the property.
Comment 3 danielr 2016-11-30 04:26:16 UTC
Created attachment 18713 [details]
test project with hacky workaround

This is an example hack/workaround.
You can start a timer with a 1ms interval to either call BeginRefresh or bind the IsRefresingProperty to your VieModel.
Comment 4 danielr 2016-11-30 04:41:35 UTC
I've created a simple BindableObject extension for now to act as a workaround until this bug is fixed.

public static class BindableObjectExtensions
{
	public static void SetBindingDelayed<T>(this BindableObject obj, BindableProperty property, Expression<Func<T, object>> source)
	{
		Device.StartTimer(TimeSpan.FromMilliseconds(1), () =>
		{
			obj.SetBinding(property, source);
			return false; //only run once
		});
	}
}
Comment 5 adrianknight89 2016-11-30 21:41:20 UTC
Was this a regression introduced recently? Looking at the tag, it says 2.3.3.
Comment 6 danielr 2016-11-30 21:55:47 UTC
I've seen several other bug reports that have similar issues.

This issue exists in 2.3.3.168
Sorry if I didn't explain the bug very well. I'll try again.

The bug exactly, is that if you turn on the "is refreshing" state either in the listview's constructor, or directly after it (like in the first testcase I attached) then the space opens up for the spinner, but it doesn't actually appear.

This is only an issue on iOS.
On Android, everything appears to work as expected but I haven't tested it thoroughly.
Comment 7 adrianknight89 2016-12-05 15:37:46 UTC
My first impression is that UIRefreshControl is supposed to show only on user action. Any programmatic way is a hack. If XF had a hacky way of doing it previously, maybe it no longer works. Also, I've read that it behaves differently on iOS 8/9 vs 10. Which version of iOS were you testing it on?
Comment 8 danielr 2016-12-05 21:37:13 UTC
I'm  testing on iOS 10.
I'll set up a sim on 8 and 9 and come back with test results.
Comment 9 danielr 2016-12-05 22:01:35 UTC
After testing, I found that this issue doesn't exist on iOS 9.3 and 8.4

It seems like it only happens on iOS 10.

I do not come from Swift or Obj-c so forgive me if being able to control the listview in this way isn't expected behaviour.

Take this with a grain of salt: I would argue that it's good to use built-in controls/views instead of creating secondary Activity Indicators just to do the same task.
Comment 10 Paul DiPietro [MSFT] 2017-11-02 00:03:31 UTC
This looks to no longer be an issue as of the latest Forms stable build on 10.3 and 11.0 sims; the indicator shows up when the application is run.