jamesmontemagno / Xamarin.Forms-PullToRefreshLayout

Pull To Refresh a ScrollView or ListView in Xamarin.Forms
218 stars 49 forks source link

Setting IsRefreshing = true not working immediately after app start #9

Closed saxx closed 8 years ago

saxx commented 8 years ago

I use the PullToRefreshLayout on my apps initial screen. In the Appearing event handler I set IsRefreshing = true, because I load some data when starting the app and I want the same "Loading" animation displayed to the user as when I do a pull to refresh.

Unfortunately, the "Loading" animation won't appear. After the initial loading is done, everything is fine and IsRefreshing = true works great and does exactly what I want (toggling the "Loading" animation).

I guess it has something to do with the initialization of the PullToRefreshLayout, because maybe it's just "not ready" yet to display the "Loading" animation immediately after the app started and the first screen is displayed. I call PullToRefreshLayoutRenderer.Init() in my main activity immediately after Forms.Init().

Thank you for this great component, it really helped me out and saved me a lot of time.

jamesmontemagno commented 8 years ago

Android or iOS?

saxx commented 8 years ago

On Android. I did not try it out on iOS, though. I use the latest stable version of Xamarin Forms.

jamesmontemagno commented 8 years ago

Mostly, this is an issue with how the pull to refresh control on Android works. I don't have any current workarounds as far as how to fix it. Usually you have to actually move the refresh down into the page and move it back up. I suggest only using it as a pull to refresh not actually setting setting the refresh to true or false is my guidance currently.

saxx commented 8 years ago

Thanks for your reply. That's what I did in the end (use a second indicator on the view to "manually" show that something is loading).