如何隐藏&在SplitView控制器中取消隐藏主视图控制器 [英] How to hide & unhide Master View Controller in SplitView Controller
本文介绍了如何隐藏&在SplitView控制器中取消隐藏主视图控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在我的XCode 4.2中创建了一个新的基于拆分视图的项目
I have created a new split view based project in my XCode 4.2
然后在 DetailViewController.m
文件中我添加了这个方法
Then in DetailViewController.m
file i have add this method
- (BOOL)splitViewController: (UISplitViewController*)svc shouldHideViewController:(UIViewController *)vc inOrientation:(UIInterfaceOrientation)orientation
{
//This method is only available in iOS5
return NO;
}
现在通过这样做我可以显示左和右我的splitview控制器的右侧部分。
Now by doing this i can able to show both left & right part of my splitview Controller at a time.
现在我在<$ c $中添加了 UIBarButtonItem
c> DetailViewController 导航栏,我想通过使用哪些我可以隐藏&在Portrairt和横向模式下显示我的主视图。
Now i have added a UIBarButtonItem
in my DetailViewController
Navigation bar and i want by using which i can hide & show my Master View both in Portrairt and Landscape Mode.
- (IBAction)hideUnhide:(id)sender
{
//How can hide & unhide
}
我该怎么做?
推荐答案
instead spv.delegate=nil; spv.delegate=self;
您需要做的下一步:
[spv willRotateToInterfaceOrientation:self.interfaceOrientation duration:0];
这篇关于如何隐藏&在SplitView控制器中取消隐藏主视图控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文