title: iOS 7 Interface Orientation
body: <p>I have an app that is always showed in portrait mode.</p>
  
  <p>But in somewhere i have a media gallery that must support landscape.</p>
  
  <p>The supported orientation by default in the project is portrait. Because of that the gallery is only showed in portrait mode.</p>
  
  <p>If i change the project setting to show in portrait and landscape the gallery works fine but i can't control the other viewControllers to show only in portrait.</p>
  
  <p>I tried several methods like shouldAutoRotate but no one worked.</p>
  
  <p>Any ideia how to solve?</p>
  
  <p>Regards</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Solved :)</p>
  
  <p>First i configured the project to support all orientation.
  Then i added this method to the AppDelegate.m:</p>
  
  <pre><code>- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
  {
      return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscape;
  }
  </code></pre>
  
  <p>After this what i did was to block orientation in each view controller, less the one i want to have orientation in landscape and portrait.</p>
  
  <p>Code to block orientation (iOS 7):</p>
  
  <pre><code>- (BOOL)shouldAutorotate
  {
      return YES;
  }
  
  - (NSUInteger)supportedInterfaceOrientations
  {
      return (UIInterfaceOrientationMaskPortrait);
  }
  </code></pre>
  
  <p>Thanks to everyone that answered me :)</p>