IOS自动旋转(3)
来源:未知 责任编辑:责任编辑 发表时间:2014-01-06 18:19 点击:次
self.view= view1;
self.view.transform= CGAffineTransformIdentity;
self.view.transform= CGAffineTransformMakeRotation(degreeToRadian(0));
self.view.bounds= CGRectMake(0.0,0.0,300.0,460.0);
NSLog(@"toportrait");
}elseif(toInterfaceOrientation== UIInterfaceOrientationLandscapeLeft){
NSLog(@"tolandscapeleft");
self.view= view2;
self.view.transform= CGAffineTransformIdentity;
self.view.transform= CGAffineTransformMakeRotation(degreeToRadian(-90));
self.view.bounds= CGRectMake(0.0,0.0,480.0,300.0);
}elseif(toInterfaceOrientation== UIInterfaceOrientationPortraitUpsideDown){
NSLog(@"toupside down");
self.view= view1; www.2cto.com
self.view.transform= CGAffineTransformIdentity;
self.view.transform = CGAffineTransformMakeRotation(degreeToRadian(180));
self.view.bounds= CGRectMake(0.0,0.0,300.0,460.0);
}else{
NSLog(@"toright");
self.view= view2;
self.view.transform= CGAffineTransformIdentity;
self.view.transform = CGAffineTransformMakeRotation(degreeToRadian(90));
self.view.bounds= CGRectMake(0.0,0.0,480.0,300.0);
}
}
-(BOOL)shouldAutorotate{
returnYES;
}
-(NSUInteger)supportedInterfaceOrientations{
returnUIInterfaceOrientationMaskAll;
}
相关新闻>>
- 发表评论
-
- 最新评论 更多>>