ios 监听设备旋转方向

-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
    if(fromInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || fromInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
    {
       
    }

     if (self.interfaceOrientation == UIDeviceOrientationPortrait){

        NSLog(@"竖直");

    }

    elseif(self.interfaceOrientation == UIDeviceOrientationLandscapeLeft)

    {

        NSLog(@"水平向左");

    }

    elseif(self.interfaceOrientation == UIDeviceOrientationLandscapeLeft)

    {

        NSLog(@"水平向左");

    }

}

 

posted on 2013-08-27 13:34  Hai_阔天空  阅读(1076)  评论(0)    收藏  举报

导航