Force iOS view to not rotate, while still allowing child to rotate

前端 未结 6 725
粉色の甜心
粉色の甜心 2021-02-02 02:42

I have a view controller with a child view controller.

tab bar controller
|
|
nav controller
|
|
UIPageViewController (should rotate)
|
|
A (Video Player) (shoul         


        
6条回答
  •  礼貌的吻别
    2021-02-02 03:16

    You can try this -

    Objective -C code if you have its alternative in swift:

    -(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
    {
       if ()//Place your condition here like if A is visible
       {
         return UIInterfaceOrientationMaskPortrait;
       }
         return UIInterfaceOrientationMaskAll;
    } 
    

提交回复
热议问题