删除拆分视图并在整个屏幕中显示另一个xib [英] Remove split view and show another xib in the whole screen
问题描述
我创建了一个iPad应用程序。在应用程序的中间,在一个按钮下我添加了一个拆分视图。单击按钮后,将成功显示拆分。但在拆分视图中我想添加一个按钮。点击按钮后,我想删除拆分视图并在整个屏幕上显示另一个xib。我怎么能这样做?
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?
推荐答案
首先我有一些问题,
-
如果你能在一个viewcontroller顶部添加一个Splitview并点击它的按钮?
if you able to add a Splitview on top of a viewcontroller with its button click?
在上面你在splitview控制器中获得方向吗?
In the above case do you get orientation in splitview controllers?
虽然我尝试这样做但我遇到了这两个问题。
While I try to do I had this two problems.
然后我做的是,在按钮上单击以显示我称为UIApplication Primary窗口的splitview,删除窗口中的所有当前视图并添加新控制器视图。
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.
与需要返回时相同。
请参阅以下代码,
- (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];
}
谢谢,
Naveen Shan
Naveen Shan
这篇关于删除拆分视图并在整个屏幕中显示另一个xib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!