现在的位置: 首页 > 综合 > 正文

ios 全屏/正常 切换时view.frame 的结构设置

2017年12月09日 ⁄ 综合 ⁄ 共 751字 ⁄ 字号 评论关闭
    if(bt.tag == 100){//转全屏
        bt.tag = 101;
        [[UIApplication sharedApplication] setStatusBarHidden:YES];

        self.view.frame = CGRectMake(0, 0, 320, 480);
       /* if (orientation == UIInterfaceOrientationLandscapeRight ||orientation == UIInterfaceOrientationLandscapeLeft) {
            aview.frame = CGRectMake(0, 0, 480, 320);
        }
        else{
            aview.frame = CGRectMake(0, 0, 320, 480);
        }*/
    }
    else{//退出全屏
        bt.tag = 100;
        [[UIApplication sharedApplication] setStatusBarHidden:NO];
        if(orientation == UIInterfaceOrientationLandscapeRight ){
            self.view.frame = CGRectMake(0, 0, 300, 480);
          //  aview.frame = CGRectMake(0, 0, 480, 300);
        }else if(orientation == UIInterfaceOrientationLandscapeLeft){
         
            self.view.frame = CGRectMake(20, 0, 300, 480);
          // aview.frame = CGRectMake(0, 0, 480, 300);
            
        }else{
            
            self.view.frame = CGRectMake(0, 20, 320, 460);
           // aview.frame = CGRectMake(0, 0, 320, 460);
        }
    }

抱歉!评论已关闭.