Split view in portrait mode!

前端 未结 6 1572
梦毁少年i
梦毁少年i 2021-01-11 10:57

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?

[splitViewCo         


        
6条回答
  •  死守一世寂寞
    2021-01-11 11:06

    For iOS5+,

    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;
    }
    

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

提交回复
热议问题