iphone - How to fix a specific orientation to a viewcontroller in IOS -
this question has answer here:
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
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:

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
Post a Comment