【问题标题】:How to hide an image for few milliseconds while page is loading.如何在页面加载时隐藏图像几毫秒。
【发布时间】:2011-07-28 18:04:13
【问题描述】:

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

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

我希望仅在加载整个页面时显示该图像。

任何帮助表示赞赏....

我的 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,因此该图像被隐藏了几毫秒,但正如我所说,我将该图像放在窗口文件中,它显示在页面加载的开头,不知道该怎么做... .

请帮忙。

【问题讨论】:

  • 你是通过xml解析来填充你的视图吗?
  • 不,我只是弹出我的页面,因为我将页面推送到非图像页面。

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


【解决方案1】:

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

如果您有一个异步加载某些数据的模型,那么您应该让图像仅在此过程结束时可见。

如果您提供更多详细信息,特别是您所说的“整个页面已加载”,我可以提供进一步的帮助。

【讨论】:

    猜你喜欢
    • 2020-08-23
    • 2020-05-25
    • 1970-01-01
    • 2017-04-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-12-17
    • 1970-01-01
    相关资源
    最近更新 更多