iphone - Force particular rotation mode on a view controller -


hi have following scenario :

1) viewcontrollera >> pushes viewcontrollerb

2) in viewcontrollerb have 3 buttons auto , landscape, portrait.

3) if user clicks on auto button particular view controller should visible in portrait + landscape mode depending on orientation mode

4) if user clicks on landscape button particular view controller should visible in landscape mode irrespective of orientation of device.

5) if user clicks on portrait particular view controller should visible in portrait mode irrespective of orientation of device.

forcing orientation on particular view controller

i working on ios 7.0 both ipad , iphone.

tried many links on stack overflow give suggestions 6.0 , doesn't work out in 7.0

can suggest me how achieve this..

try this..

create property orientationstyle nsinteger in appdelegate , change value of orientationstyle viewcontrollerb according button click.

add below method in appdelegate.

- (nsuinteger)application:(uiapplication *)application supportedinterfaceorientationsforwindow:(uiwindow *)window { switch (orientationstyle) {     case 0:         return uiinterfaceorientationmaskportrait;         break;     case 1:         return uiinterfaceorientationmasklandscape;         break;     case 2:         return uiinterfaceorientationmaskall;         break;      default:         return uiinterfaceorientationmaskall;         break; } } 

hope you


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -