1

I have a video view that I want shown in landscape but everything else in my app is portrait only. I'm not sure how to accomplish this.

raginggoat
  • 3,570
  • 10
  • 48
  • 108

2 Answers2

0

You should make it so the user rotates to landscape to play the video in that orientation and when the user rotates to landscape you should hide any ability to navigate back to where you want the app to remain portrait only. This will force the user to rotate back to portrait and then you can show your navigation or whatever controls you want to show to leave that view. By doing this you are keeping a logical flow to how your app behaves.

rooster117
  • 5,502
  • 1
  • 21
  • 19
0

See my answer here, including a test project. It demonstrates exactly what you want to achieve.

Basically, orientation can only be forced to change when presenting a view controller modally. For example, media playback in some apps. If you wish to transition from a view controller that can only be presented in portrait to a view controller that is only presented in landscape, you will need a modal presentation. Push will not work.

Community
  • 1
  • 1
Léo Natan
  • 56,823
  • 9
  • 150
  • 195