本文介绍了以纵向模式拆分视图!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Apple仅为横向提供分割视图,但不为纵向模式提供分割视图。有没有办法在纵向模式下实现splitview?

Apple provide the split view only for landscape but not for the portrait mode. Is there any way to achieve the splitview in portrait mode also?

[splitViewController setHidesMasterViewInPortrait:NO];

这将有效。但是这个API没有记录(私人)。

This will work. But this API is not documented(private).

谢谢,

Manjunath

Thanks,
Manjunath

推荐答案

对于iOS5 +,

转到 detailViewController 。你的 detailViewController 应该有 UISplitViewControllerDelegate 。只需将此代码放入:

Go to your detailViewController. Your detailViewController should have UISplitViewControllerDelegate. And simply just drop this code in:

- (BOOL)splitViewController:(UISplitViewController *)svc shouldHideViewController:(UIViewController *)vc inOrientation:(UIInterfaceOrientation)orientation{
    return NO;
}

这样就可以了。它是公共API。

This will do the trick. And it is public API.

这篇关于以纵向模式拆分视图!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-14 12:40