views:

225

answers:

1

'lo all.

I am in the ending portion of my app for the iPhone and found that I am in a section of the app where I want to give feedback about the status of some background process running (location manager accuracy) and want to place it in the lower left of the screen. This can tell a user how "sure" we are about the given search results they are receiving from my app.

Several issues. This is a navigation-based app (just so you know). I want to float a (for instance) 40px high, 80 (or so) pixel wide translucent black (maybe alpha .6) box with rounded corners at the bottom left of the screen above the tabbar. I want to be able to make it appear upon demand (when location manager gets called) and disappear when i stop location manager -- BUT float over the app on ALL VIEWS of the app and NOT block touches as the user navigates through the app. Is this all possible? And, if so, how? Code would be best but I am not asking for beginning to end solution.

I just do not "get" the following:

  • I do not understand if i can float a box above all views of an app at all times.
  • Where to start...what "object" do i use to build it? CALayer? CGRect? I want to be able to say (for instance) "Accuracy: 10" (and have the number change colors...dont know if that limits me to the object that I can put it on.
  • CANNOT block touches. and would LIKE to make it so it stays floating above the app when the user touches the screen and changes a view.

Is all this possible and if so, can someone give me a good starting point? I have all the programming necessary to GET the location manager values...but dont know how to put a view above the other views without pushing the others off the screen...OR something like this...which blocks and is an AlertView .. not the item i need:

// this is not the answer for what I need
baseAlert = [[[UIAlertView alloc] initWithTitle:@"One Moment" message:nil delegate:self cancelButtonTitle:nil otherButtonTitles: nil] autorelease];
[baseAlert show];
// Create and add the activity indicator
UIActivityIndicatorView *aiv = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
aiv.center = CGPointMake(baseAlert.bounds.size.width / 2.0f, baseAlert.bounds.size.height - 40.0f);
[aiv startAnimating];
[baseAlert addSubview:aiv];
[aiv release];

The perfect thing for me would be (and I do not know if it can be done) the "return to call" green style status bar that apple puts up when you are on a call underneath the iPhone status bar.. I know that is not available to programmers tho.

Anyway, any help would be appreciated. Thx in advance.

+1  A: 

You should be able to create a UIView and add it to your main window as a subview.

That will display it on top of anything else you have. You can then use userInteractionEnabled property to disable user interaction of that view.

pgb
Thx...but when I have the navigationcontroller control the switching of the screen (by the user clicking on the tabbar) that uiview will be gone, am i correct? I would have to check on the new view (that the user went to) and see if i should re-display that uiview that contained the "Accuracy: 10" text?
Jann
If you add the view to the main window, it won't be gone. The Navigation Controller switches views that are childs of the window. My suggestion is to have a second child of the window be your alert box.
pgb
I did this, pgb, and it works great! App is currently under review for sale -- THANKS! It would not have been possible without your help.
Jann