• IOS翻转时,使用2个view的交换(需注意)


    - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)
    interfaceOrientation duration:(NSTimeInterval)duration {
        if (interfaceOrientation == UIInterfaceOrientationPortrait) {
            self.view = self.portrait;
            self.view.transform = CGAffineTransformIdentity;
            self.view.transform =
            CGAffineTransformMakeRotation(degreesToRadians(0));
            self.view.bounds = CGRectMake(0.0, 0.0, 320.0, 460.0);//纵方向-20
        }
        else if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
            self.view = self.landscape;
            self.view.transform = CGAffineTransformIdentity;
            self.view.transform =
            CGAffineTransformMakeRotation(degreesToRadians(-90));
            self.view.bounds = CGRectMake(0.0, 0.0, 480.0, 300.0);
        }
        else if (interfaceOrientation ==
                 UIInterfaceOrientationPortraitUpsideDown) {
            self.view = self.portrait;
            self.view.transform = CGAffineTransformIdentity;
            self.view.transform =
            CGAffineTransformMakeRotation(degreesToRadians(180));
            self.view.bounds = CGRectMake(0.0, 0.0, 320.0, 460.0);
        }
        else if (interfaceOrientation ==
                 UIInterfaceOrientationLandscapeRight) {
            self.view = self.landscape;
            self.view.transform = CGAffineTransformIdentity;
            self.view.transform =
            CGAffineTransformMakeRotation(degreesToRadians(90));
            self.view.bounds = CGRectMake(0.0, 0.0, 480.0, 300.0);
        }
    }

  • 相关阅读:
    js数组删除数组元素!收集
    ComponentArt MethodNeedDataSource etc.
    ComponentArt Grid Tips
    jira的附件位置如何查看
    有空来学习
    给你的windows设置博客园客户端,还等什么呢,赶快行动吧
    需要做的事
    那些事
    转帖:教你怎么偷懒
    买了电脑要做的几件事
  • 原文地址:https://www.cnblogs.com/tx8899/p/2542886.html
Copyright © 2020-2023  润新知