iphone - Make 1 UIViewController Landscape Mode -


this question has answer here:

my ios app built in portrait format , want keep way. there 1 screen in landscape only, not portrait can't figure how it.

is there advised?

much appreciated

at first should set orientation on supported interface orientation in xcode project summary. in appdelegate:

- (nsuinteger) application: (uiapplication*) application supportedinterfaceorientationsforwindow: (uiwindow*) window {     nsuinteger orientations = uiinterfaceorientationmaskall;      if (self.window.rootviewcontroller)     {         uiviewcontroller* rootviewcontroller = self.window.rootviewcontroller;         uiviewcontroller* presented;          if ([rootviewcontroller iskindofclass: [uinavigationcontroller class]])         {             presented = [[(uinavigationcontroller*) rootviewcontroller viewcontrollers] lastobject];         }         else         {             presented = (uiviewcontroller*) rootviewcontroller;         }          orientations = [presented supportedinterfaceorientations];     }      return orientations; } 

then in every uiviewcontroller:

- (nsuinteger) supportedinterfaceorientations {     return uiinterfaceorientationmaskportrait; } 

in need other orientation should change uiinterfaceorientationmaskportrait uiinterfaceorientationmasklandscapeleft or another.


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -