2 ideas.... I've seen problems when executing code on the UI thread right after
a call to a UI element (also check that you are calling this on the main/UI
thread).
#1
UIApplication.SharedApplication.NetworkActivityIndicatorVisible = true;
StyledStringElement btnLogin = new StyledStringElement("Login", delegate {
DoLogin(); });
public void DoLogin()
{
try {
... do work
}
finally {
UIApplication.SharedApplication.NetworkActivityIndicatorVisible = false;
}
}
#2
StyledStringElement btnLogin = new StyledStringElement("Login", delegate {
DoLogin(); });
public void DoLogin()
{
UIApplication.SharedApplication.NetworkActivityIndicatorVisible = true;
NSRunLoop.Current.RunUntil(DateTime.Now.AddMilliseconds(1));
try {
... do work
}
finally {
UIApplication.SharedApplication.NetworkActivityIndicatorVisible = false;
}
}
Dino
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of danmiser
Sent: Friday, March 02, 2012 11:20 AM
To: [email protected]
Subject: [MonoTouch] NetworkActivityIndicatorVisible with MonoTouch.Dialog
Has anyone got the NetworkActivityIndicatorVisible to work on the device while
using MonoTouch.Dialog?
I create a button like this:
StyledStringElement btnLogin = new StyledStringElement("Login", delegate {
DoLogin(); });
When I click the button it does take me to this method:
public void DoLogin()
{
UIApplication.SharedApplication.NetworkActivityIndicatorVisible = true;
try {
... do work
}
finally {
UIApplication.SharedApplication.NetworkActivityIndicatorVisible = false;
}
}
The spinning indicator doesn't show up. I've tried while debugging and tethered
via USB, and also by just running the app with a wifi connection.
I'm using MT 5.2.
Anyone seeing the same thing? Anything look obviously wrong?
Thanks
--
View this message in context:
http://monotouch.2284126.n4.nabble.com/NetworkActivityIndicatorVisible-with-MonoTouch-Dialog-tp4439142p4439142.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch