在window上旋转

来源:互联网 发布:贵州网络直报系统 编辑:程序博客网 时间:2024/04/29 12:20
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight) {  [self.view setBounds:CGRectMake(0, 0, 1024, 768)];  [self.view setCenter:CGPointMake(384, 512)];  [self.view setTransform:CGAffineTransformMakeRotation(M_PI/2)];[loginView_ setCenter:CGPointMake(512, 384)];}else if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft) {  [self.view setBounds:CGRectMake(0, 0, 1024, 768)];  [self.view setCenter:CGPointMake(384, 512)];  [self.view setTransform:CGAffineTransformMakeRotation(M_PI *1.5)];[loginView_ setCenter:CGPointMake(512, 384)];}else if (toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {  [self.view setBounds:CGRectMake(0, 0, 768, 1024)];  [self.view setCenter:CGPointMake(384, 512)];  [self.view setTransform:CGAffineTransformMakeRotation(M_PI)];[loginView_ setCenter:CGPointMake(384, 512)];}else {[self.view setBounds:CGRectMake(0, 0, 768, 1024)];  [self.view setCenter:CGPointMake(384, 512)];  [self.view setTransform:CGAffineTransformMakeRotation(M_PI*2)]; [loginView_ setCenter:CGPointMake(384, 512)];}