• IOS翻转注意


    翻转时,要计算好。如下是6个button的翻转中 frame 的改变

    - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
    {
        if (toInterfaceOrientation == UIInterfaceOrientationPortrait || toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {//翻转0或180度时的情况
            button1.frame = CGRectMake(20, 20, 125, 125);
            button2.frame = CGRectMake(175, 20, 125, 125);
            button3.frame = CGRectMake(20, 168, 125, 125);
            button4.frame = CGRectMake(175, 168, 125, 125);
            button5.frame = CGRectMake(20, 315, 125, 125);
            button6.frame = CGRectMake(175, 315, 125, 125);
        }
        else                                                          //翻转90或270度时的情况
        {
            button1.frame = CGRectMake(20, 20, 125, 125);
            button2.frame = CGRectMake(20, 155, 125, 125);
            button3.frame = CGRectMake(177, 20, 125, 125);
            button4.frame = CGRectMake(177, 155, 125, 125);
            button5.frame = CGRectMake(328, 20, 125, 125);
            button6.frame = CGRectMake(328, 155, 125, 125);        
        }
    }

  • 相关阅读:
    Redis常见数据类型
    MYSQL常见可优化场景
    算术切片
    找数组里没出现的数
    不同路径和(II)
    不同路径和
    最小路径和
    强盗抢房子
    丑数(2)
    判断子序列
  • 原文地址:https://www.cnblogs.com/tx8899/p/2536352.html
Copyright © 2020-2023  润新知