PDA

View Full Version : Displaying and Hidding views




StrAbZ
May 19, 2008, 02:36 PM
I've try to search but I didn't find anything about my problem.

I'm trying to do a loading view or anything that can display, a gear, like a buttonBarItem with custom view, or a view with black background and alpha effect (like the "old" UIProgressHud, is there something to replace it?).

So i've my code which look like this :


// Step1 - Loading View (adding the button, or the view etc...)
UIActivityIndicatorView aiv = [[UIActivityIndicatorView alloc] initWithStyle...]
UIButtonBarItem *bbi = [[UIButtonBarItem alloc] initWithCustomView: aiv];
[[self navigationItem] setRightButtonBarItem: bbi];

// Step2 - Doing some stuff (loading data from url (synchronously),
having 1min while{} etc...

// Step3 - Removing View (removing the button, or the view etc...)
[[self navigationItem] setRightButtonBarItem: nil];



If I only write step1 and step2, my loading view is displayed, but never disappear, right but not good...
My problem is when I add the third step, my view doesn't show up... (I have the same problem if I create a UIView, which I add and remove from [self view]

So if you have any idea I'll take it !

Thank you



StrAbZ
May 20, 2008, 05:35 PM
Nobody with a idea?

In short, i cannot create a View, and add it as a subview and remove it.
I just can add it.

If i try to put some code to remove it, the add doesn't work.

5et
Jul 31, 2008, 12:09 PM
maybe you know how I can create small modal dialog with label and UIActivityIndicatorView on current view controller?