How to get default LandscapeLeft Orientation in iOS5?

前端 未结 4 1073

Sorry if this question is duplicate, but I can\'t find the same solution. In iOS6, if I want to set default orientation for one UIViewController, I just use:

- (         


        
4条回答
  •  情深已故
    2021-01-28 02:46

    call the below method where you want to check the status of orientation.happy coding :-)

    - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
    {
        [self CheckForViewForOrientation:toInterfaceOrientation];
    }
    
    - (void) CheckForViewForOrientation:(UIInterfaceOrientation)orientation
    {
        if (orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown)
        {
            //Ur lable portrait view
        }
        else if (orientation == UIInterfaceOrientationLandscapeLeft || orientation == UIInterfaceOrientationLandscapeRight)
        {
            //Ur lable for landscape view
        }
    }
    

提交回复
热议问题