Search code examples
ios5xcode5childviewcontroller

iOS 5.1 Xcode 5 Child View Controller Orientation did not change


in iOS5 with Xcode5 my application support only Landscape orientation when i add child view controller its on portrait and not rotate to landscape mode??


Solution

  • Add Child view controller in this pattern:

    UIViewController *controller = [[UIViewController alloc]init];
    [self addChildViewController:controller];
    controller.view.frame = self.view.frame;
    [self.view addSubview:controller.view];
    [controller didMoveToParentViewController:self];
    

    its follow the same orientation of parent view controller