Iphone Developer
Iphone Developer

Reputation: 163

How to hide an image for few milliseconds while page is loading.

I have a common image on number of pages of my project, so I place that image on window file. As some pages need not to display that image so i hide that image on corresponding pages.

Now problem arises, as i pop from non- image page to page containing image, that image displays before loading the whole page.

I want that image to appear only when whole page is loaded.

Any help is appreciated....

code of my firstViewController:

ProfileViewController *ProfilePage = [[ProfileViewController alloc] initWithNibName:@"ProfileViewController" bundle:nil];   
ProfilePage.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;    
UINavigationController *navigationControllerNew = [[UINavigationController alloc] initWithRootViewController:ProfilePage];  
//Present navigationController as Model viw controller  
[self.navigationController presentModalViewController:navigationControllerNew animated:YES];        
//release it After presenting to it
[navigationControllerNew release];
[ProfilePage release];  

on ProfileViewController page I am hiding image with following code:

    [super viewWillAppear:animated];

IQ_TestAppDelegate *appDelegate = (IQ_TestAppDelegate *)[[UIApplication sharedApplication] delegate];
[appDelegate removeImageViewLogo];

this how I am calling my Pages....

EDIT: I have already used NSTimer, so that image is hidden for some milliseconds, but as i told I placed that image in window file, it displays at the beginning of the page loading, dont know wat to do....

Please help.

Upvotes: 0

Views: 155

Answers (1)

sergio
sergio

Reputation: 69027

You should try and display (make visible) the image in the viewDidLoad method of your controller.

If you have a model that loads some data asynchronously, then you should make the image visible only at the end of this process.

If you provide more details, specifically what you mean by "whole page is loaded", I can help further.

Upvotes: 2

Related Questions