我在 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模板网!
如何通过点击动画 UIImageview 以显示全屏?How to animate a UIImageview to display fullscreen by tapping on it?(如何通过点击动画 UIImageview 以显示全屏?)
停止 segue 并显示警报To stop segue and show alert(停止 segue 并显示警报)
iOS 5 故事板,以编程方式确定路径iOS 5 storyboard, programmatically determine path(iOS 5 故事板,以编程方式确定路径)
图标已经包含光泽效果Icon already includes gloss effects(图标已经包含光泽效果)
UIEdgeInsetsMake 是如何工作的?How does UIEdgeInsetsMake work?(UIEdgeInsetsMake 是如何工作的?)
UIProgressView 和自定义跟踪和进度图像(iOS 5 属性UIProgressView and Custom Track and Progress Images (iOS 5 properties)(UIProgressView 和自定义跟踪和进度图像(iOS 5 属性))