Follow me on Twitter at Twitter.com/wbm
FYI, I'm blogging most of my stuff over at More Wally now.
You might want to add my rss feed to your reader at:http://morewally.com/cs/blogs/wallym/rss.aspx
UIRefreshControl Timeout with Xamarin.iOS - Wallace B. McClure

Wallace B. McClure

All About Wally McClure - The musings of Wallym on Web, HTML5, Mobile, Xamarin.iOS, Xamarin.Android, and Windows Azure.

News

Visual Studio Magazine Column Personal Blog

.NET

Book Authors

Business

Family

Friends

Georgia Tech Bloggers

Personal

Archives

UIRefreshControl Timeout with Xamarin.iOS

The UIRefreshControl doesn't have a timeout mechanism built into it.  Once the refresh begins, the control will display that a refresh is occurring until the .EndRefreshing() method is called.  Because we are in a mobile environment, the data may never come back.  We don't want to display the UIRefreshControl forever.  Solving this problem is actually pretty simple.  Setup a timer and when the timer runs, call .EndRefreshing().  Here is some code I used for this:

nstRefresh = NSTimer.CreateScheduledTimer( new TimeSpan(0,0,20), delegate{
BeginInvokeOnMainThread(delegate{
if( uir.Refreshing )
{    
       uir.EndRefreshing();
}
});
nstRefresh = null;
});
 

I hope that this helps

Posted: Aug 21 2013, 05:04 AM by Wallym | with no comments
Filed under: , ,

Comments

No Comments