Remove split view and show another xib in the whole screen

青春壹個敷衍的年華 提交于 2019-12-11 07:45:17

问题


I have created an iPad app. In the middle of the app, under a button I have added a split view. After the button is clicked the split is shown successfully. But in the split view I want to add a button. When the button is tapped then I want to remove the split view and show another xib in whole screen. How can I do that?


回答1:


First I had some questions,

  1. if you able to add a Splitview on top of a viewcontroller with its button click?

  2. In the above case do you get orientation in splitview controllers?

While I try to do I had this two problems.

Then What I do is, On a button click to show the splitview I called UIApplication Primary window, remove all current views in window and Add the new controllers view.

Do the Same as when need to go back.

See the following code,

- (void) displayControllerViewStack: (UIView *)view {

    NSArray *subViews = [self.window subviews];
    while ([subViews count] > 0 )   {
            // Need to clear out the list, as only view at index 0 gets rotation notification.
            [(UIView *)[subViews objectAtIndex:0] removeFromSuperview];
            subViews = [self.window subviews];
     }
[self.window addSubview: view];
}

thanks,

Naveen Shan



来源:https://stackoverflow.com/questions/9782968/remove-split-view-and-show-another-xib-in-the-whole-screen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!