简体   繁体   English

在返回MainView时隐藏所有对象

[英]Hiding all objects upon return to MainView

in a utility application, in the viewDidLoad method, I have the following functions, among others: 在实用程序应用程序的viewDidLoad方法中,我具有以下功能,其中包括:

[self hideObjects];
[self setColorAndSizes];
[self fadeInEverything];

These three methods, combined, first hide all objects on the screen, then adjust the sizes and colors appropriately, and then fade each of them into view, one at a time. 结合使用这三种方法,首先隐藏屏幕上的所有对象,然后适当调整大小和颜色,然后将它们中的每一个淡入一次。 Now, when the user goes to the FlipsideView, then returns to the MainView, although I have the same three functions in viewDidAppear, all of the objects appear for maybe half a second, then disappear, and fade in. Why don't the hide immediately, like they do in the viewDidLoad method? 现在,当用户转到FlipsideView,然后返回MainView时,尽管我在viewDidAppear中具有相同的三个功能,但所有对象可能会出现半秒钟,然后消失并逐渐消失。为什么不隐藏立即,就像在viewDidLoad方法中一样?

viewDidLoad is called when the view loads. 视图加载时将调用viewDidLoad。 However, in a utility application that has the flip, when the app flips to reveal the backside, MainView really never goes away. 但是,在具有翻转功能的实用程序应用程序中,当应用程序翻转以显示背面时,MainView实际上永远不会消失。 All you're doing when you hit the back button is DISMISSING the FlipsideView. 当您按下“后退”按钮时,您正在做的只是“取消FlipsideView”。 MainView appears again, but isn't loaded. MainView再次出现,但未加载。 Do you see this code in MainView.m? 您在MainView.m中看到此代码了吗? This is why: 这就是为什么:

- (void)flipsideViewControllerDidFinish:(FlipsideViewController *)controller {

        [self dismissModalViewControllerAnimated:YES];
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM