Question

My app is a portrait app, now I want to put a view controller in landscape. There's a easy way to do that? I set the device info only in portrait now I've a view controller in which there are a media player and I think it's better to watch this video in landscape mode. I tried this methods:

  • - (BOOL)shouldAutorotate: doesn't work
  • - (NSUInteger)supportedInterfaceOrientations: doesn't works

You know if there's a way to solve this without redo all app inserting category?

Était-ce utile?

La solution

You have 2 things to do :

  • Set the supported device orientations on the target info enter image description here

  • Set the (NSUInteger)supportedInterfaceOrientations method for your viewController. If this view is only supposed to show the video I guess you should only allow UIInterfaceOrientationMaskLandscape.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top