force UIViewController to be in Landscape mode iOS7

前端 未结 2 814
孤独总比滥情好
孤独总比滥情好 2020-12-21 07:16

I\'ve implemented the proper functions, but they don\'t get triggered? I\'ve tried several solutions here on StackOverFlow, but none of them work. I\'ve tried adding the vie

相关标签:
2条回答
  • 2020-12-21 07:45

    For a navigation controller interface, forcing an orientation is not supported by the framework. See my answer here: https://stackoverflow.com/a/15301322/341994

    For a workaround (not very good), see my answer here: https://stackoverflow.com/a/16379515/341994

    However, forcing an orientation works fine for a presented view controller.

    0 讨论(0)
  • 2020-12-21 07:58

    If you are pushing a view controller to a stack of other view controllers in a navigation controller, requiring landscape only will not work well. You should display the landscape-constraint view controller modally.

    See my answer here for an example project: https://stackoverflow.com/a/16022631/983912

    0 讨论(0)
提交回复
热议问题