문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top