如何在加载页面时隐藏图像几毫秒。

时间:2011-07-28 18:04:13

标签: iphone objective-c cocoa-touch ios4 uiimage

我的项目页面上有一个共同的图像,因此我将该图像放在窗口文件中。 由于某些页面无需显示该图像,因此我将该图像隐藏在相应的页面上。

现在出现问题,因为当我从非图像页面弹出到包含图像的页面时,该图像会在加载整个页面之前显示。

我希望只有在加载整个页面时才会显示该图像。

感谢任何帮助......

我的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];  
在ProfileViewController页面上的

我使用以下代码隐藏图像:

    [super viewWillAppear:animated];

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

这就是我如何调用我的页面....

编辑:我已经使用过NSTimer,因此图像隐藏了几毫秒,但正如我告诉我将该图像放在窗口文件中,它显示在页面加载的开头,不知道要做什么......

请帮忙。

1 个答案:

答案 0 :(得分:2)

您应该尝试在控制器的viewDidLoad方法中显示(显示)图像。

如果你有一个以异步方式加载某些数据的模型,那么你应该只在这个过程结束时使图像可见。

如果您提供更多详细信息,特别是“整页加载”的含义,我可以提供更多帮助。