我在 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;
}
现在通过这样做,我可以同时显示 left &我的 splitview 控制器的右侧部分.
Now by doing this i can able to show both left & right part of my splitview Controller at a time.
现在我在我的 DetailViewController
导航栏中添加了一个 UIBarButtonItem
,我想通过使用它来隐藏 &在纵向和横向模式下显示我的主视图.
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 控制器中取消隐藏主视图控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!