ios - After dismissViewController my view remain in previous view controller's orientation in iOS7 -


as working ios application support portrait orientation. getting orientation related issue.

  • my app support portrait orientation

  • when parent p1.view push using navigation in portrait mode thats fine. p1.view subviewing child view c1.view

  • now in childview c1.view , there using delegate calling

    -(void)imagepickercontroller:(uiimagepickercontroller *)picker

    [self.delegate opencamera];//called c1.view

    -(void)opencamera   //declared in p1.view     {         uiimagepickercontroller *picker = [[uiimagepickercontroller alloc] init];         picker.delegate = self;         picker.allowsediting = no;         picker.sourcetype = uiimagepickercontrollersourcetypecamera;>                      [self presentmodalviewcontroller:picker animated:yes];     } 
  • now when capture photo in lanscape mode , dismiss presentmodalviewcontroller view appears in landscapmode instead of portrait mode.

        - (bool)shouldautorotate {         return yes;     }     - (bool)shouldautorotatetointerfaceorientation:(uiinterfaceorientation)interfaceorientation{      return (interfaceorientation == uiinterfaceorientationportrait ||             interfaceorientation == uiinterfaceorientationportraitupsidedown);     }      - (nsuinteger)supportedinterfaceorientations {             return (uiinterfaceorientationmaskportrait | uiinterfaceorientationmaskportraitupsidedown);     }     - (uiinterfaceorientation)preferredinterfaceorientationforpresentation {         return (uiinterfaceorientationmaskportrait | uiinterfaceorientationmaskportraitupsidedown);     } 

this methods define in both view controller(p1 & c1) , called when modelview dismiss, but​ viewcontroller remains in landscape should ​not happen.

this code working fine in ios6 not ios7

i think preferredinterfaceorientationforpresentation not supposed return bit mask. try:

- (uiinterfaceorientation)preferredinterfaceorientationforpresentation { return uiinterfaceorientationportrait; }


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -