iphone - How to fix a specific orientation to a viewcontroller in IOS -


i working on ipad app. capture image in popover , crop image in full screen in next view. here consists of following screens

1) loginviewcontoller(need orientations),

2)splitviewcontroller(need orientations),`

3)imagecropviewcontroller(need landscape),

4)settingsviewcontroller(need orientations).

in imagecropviewcontroller writing following code:

- (bool)shouldautorotate {     return no; }  -(nsuinteger)supportedinterfaceorientations {     return uiinterfaceorientationmasklandscape; } 

i getting exact orientation. effecting loginviewcontroller's , settingviewcontroller's orientation also.

in loginviewcontroller , settingviewcontroller ,i writing following code

- (bool)shouldautorotate     {         return yes;     }  -(nsuinteger)supportedinterfaceorientations {     return uiinterfaceorientationmasklandscape | uiinterfaceorientationmaskportrait | uiinterfaceorientationmaskportraitupsidedown; } 

while navigating splitviewcontroller imagecropviewcontroller ,i initiating imagecropviewcontroller rootviewcontroller.

in plist have supported orientations this

enter image description here googled it. , integrated available codes. did not find solution. please me. killing time.

this way have set on iphone project shouldn't different yours:

first, make sure project supports of desired orientations:

supported interface orientations

then, override these methods on splitviewcontroller, imagecropviewcontroller , settingsviewcontroller:

- (bool)shouldautorotate {     return yes; }  - (nsuinteger)supportedinterfaceorientations {     return uiinterfaceorientationmaskall; } 

finally, override these methods on imagecropviewcontroller:

- (bool)shouldautorotate {     return yes; }  - (nsuinteger)supportedinterfaceorientations {     return uiinterfaceorientationmasklandscape; } 

let me know if helps!


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -