ipad上自定义view的旋转适配

ios8横屏时宽高会自动转换,但是ios7不是

   CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width;

    CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height;

    if (!iOS8)

    {

        UIInterfaceOrientation interfaceOrientation = [[UIApplication sharedApplication] statusBarOrientation];

        if (UIInterfaceOrientationIsLandscape(interfaceOrientation))

        {

            CGFloat tmp = screenWidth;

            screenWidth = screenHeight;

            screenHeight = tmp;

        }

    }

   

原文地址:https://www.cnblogs.com/zhangliukou/p/4486825.html