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

    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);
        }
    }

你可能感兴趣的:(ios 全屏/正常 切换时view.frame 的结构设置)