0

I'm having 5 view controllers in my navigation based application, I need to support both landscape/Portrait mode in only a one view, following items displaying in the view Navigationbar Tool bar with two buttons UIImageView in center. UILabe below the navigaton bar.

Can any one help me how to support the orientation change to only for this view.

Regards,

sam.

Sam
  • 6,215
  • 9
  • 71
  • 90

1 Answers1

0

You should use shouldAutorotateToInterfaceOrientation in your view controller, and return YES for view controllers that should support both Landscape/Portrait

http://developer.apple.com/library/ios/documentation/uikit/reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instm/UIViewController/shouldAutorotateToInterfaceOrientation:

Deniz Mert Edincik
  • 4,336
  • 22
  • 24
  • well i override the shouldAutorotateToInterfaceOrientation: to return the "YES", but no luck, i only need one view to support the landscape/Portrait orientation...,so i did not override the shouldAutorotateToInterfaceOrientation in other view controllers. – Sam Oct 23 '10 at 12:10
  • I guess your case is : "All child view controllers in your UITabBarController or UINavigationController do not agree on a common orientation set. To make sure that all your child view controllers rotate correctly, you must implement shouldAutorotateToInterfaceOrientation for each view controller representing each tab or navigation level. Each must agree on the same orientation for that rotate to occur. That is, they all should return YES for the same orientation positions." http://developer.apple.com/library/ios/#qa/qa2010/qa1688.html – Deniz Mert Edincik Oct 23 '10 at 19:25
  • I think you should rotate manually with self.view.transform. And getting rotation alerts by deviceNotifications. – Deniz Mert Edincik Oct 23 '10 at 19:32