objective c - How can I manually change the orientation -


my app should start landscape mode. change orientation of phone. how manually.i tried doesn't work.

 shouldautorotatetointerfaceorientation: 

is there other way??

in project settings, can set orientations app permits. set landscapeleft , landscaperight. prevent app going potrait mode, irrespective of orientation of device before app started.

manually force change orientation

in ios, cannot directly set device orientation manually. however, can use method work done.

[[uiapplication sharedapplication] setstatusbarorientation:uiinterfaceorientationlandscapeleft  animated:no]; 

the usual way

alternatively, can goto implementation file can specify allowed orientations in method:

- (bool)shouldautorotatetointerfaceorientation:(uiinterfaceorientation)interfaceorientation { //return yes if want allow orientations return uiinterfaceorientationlandscaperight; //if want allow landscape right &c } 

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 -