zoukankan      html  css  js  c++  java
  • 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);        
        }
    }

  • 相关阅读:
    在线漏洞检测网站
    渗透测试工具库
    端口利用解析
    Linux安全脚本
    Linux常见系统故障
    Oracle
    Redis和MongoDB区别
    MHA在监控和故障转移时都做了什么
    Oracle 11g Dataguard参数详解
    Oracle
  • 原文地址:https://www.cnblogs.com/tx8899/p/2536352.html
Copyright © 2011-2022 走看看