Modal View Controller force Landscape orientation in iOS 6

前端 未结 4 850
陌清茗
陌清茗 2021-02-15 11:41

I have a UITabBarController presented in Portrait mode. On one of the tabs I have a button that shows a UIViewController modally (A simple storyboard segue performs the action).

4条回答
  •  情歌与酒
    2021-02-15 11:44

    I do exactly this in my app, and do it via shouldAutoRotateToInterfaceOrientation, slightly differently than you:

    - (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
     if (UIInterfaceOrientationIsLandscape(interfaceOrientation))
      return (YES);
     return (NO);
    }
    

    for iOS 6, you must also set window.rootViewController = {your root view controller}; in your app delegate. I'm hoping this is your issue

提交回复
热议问题