开发者

Hide a view controller's view while flipping a view

I have 3 views in my app. Main view has 2 buttons and when selected it displays 2nd view(which again has buttons and displays a 3rd view with images). I have a home button on second view. When pressed I want to show the main view. I can do this if I add the 2nd view as subview

[self.view addSubview:secondViewController.view]

But whenever 2nd view flips to display the 3rd view, I can see the main view while it is flipping.

Now if I add 2nd view as below self.view = secondViewController.view then I dont have the main view to display when the home button is pressed.

How can 开发者_高级运维I hide the main view when 2nd view is flipping to show 3rd view?


You might be able to just set the main view's alpha property to 0 before you flip and 1 after you flip back.

I'm not sure what you're app looks like, but it sounds like you're reproducing a lot of behaviour given to you by navigation-based apps for free. Just a suggestion.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜