如何以编程方式隐藏 UISplitViewController 的主部分? [英] How do I hide the master part of a UISplitViewController programatically?
本文介绍了如何以编程方式隐藏 UISplitViewController 的主部分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的 UISplitViewController 中,当用户单击横向按钮时,我希望视图的主"部分隐藏自身,而细节"部分接管全屏.同样,再次单击该按钮会使用户返回标准的分屏视图.是否可以使用内置类来做到这一点?
In my UISplitViewController, I want the "master" part of the view to hide itself and the "detail" part take over the full screen when the user clicks a button in landscape. Likewise, clicking the button again takes the user back the standard, split screen view. Is it possible to do this with the built-in class?
推荐答案
iOS5 中有一个方法可以从 UISplitViewControllerDelegate 实现:
There's a method you can implement from UISplitViewControllerDelegate in iOS5:
- (BOOL)splitViewController:(UISplitViewController*)svc
shouldHideViewController:(UIViewController *)vc
inOrientation:(UIInterfaceOrientation)orientation
{
return YES;
}
MGSplitViewController 为 ios5 之前的工作内置了该功能.
MGSplitViewController has that functionality built in for pre-ios5 work.
这篇关于如何以编程方式隐藏 UISplitViewController 的主部分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文