重庆分公司,新征程启航
为企业提供网站建设、域名注册、服务器等服务
突然不想说了参考了
成都创新互联公司专业为企业提供哈密网站建设、哈密做网站、哈密网站设计、哈密网站制作等企业网站建设、网页设计与制作、哈密企业网站模板建站服务,十载哈密做网站经验,不只是建网站,更提供有价值的思路和整体网络服务。
http://blog.sina.com.cn/s/blog_7cac8562010112ch.html
赶时间了,不细细说了
解决方案是:
- //
- // MNViewController.m
- // LeeDemoProject
- //
- // Created by mobilenow03 on 12-10-29.
- // Copyright (c) 2012年 mobilenow03. All rights reserved.
- //
- #import "SecondVC.h"
- #import
- @interface SecondVC ()
- @end
- @implementation SecondVC
- @synthesize _imgVBackground,_vTransform;
- - (void)dealloc {
- [_imgVBackground release];
- [_vTransform release];
- [super dealloc];
- }
- - (void)viewDidLoad
- {
- [super viewDidLoad];
- // Do any additional setup after loading the view, typically from a nib.
- // [UIView beginAnimations:nil context:nil];
- //
- // [UIView setAnimationDuration:0.3];
- //设置导航栏旋转
- self.navigationController.navigationBarHidden = YES;
- }
- - (id)init
- {
- self = [super init];
- if (self)
- {
- // [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
- // [[NSNotificationCenter defaultCenter] addObserver:self
- // selector:@selector(orientationChanged:)
- // name:UIDeviceOrientationDidChangeNotification
- // object:nil];
- }
- return self;
- }
- -(void)viewDidUnload
- {
- [self set_vTransform:nil];
- [super viewDidUnload];
- }
- -(void)viewWillAppear:(BOOL)animated
- {
- [super viewWillAppear:animated];
- self.view.bounds = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
- self.view.transform = CGAffineTransformMakeRotation( M_PI*1.5);
- // if ([[UIDevice currentDevice].systemVersion floatValue] >= 6.0) {
- // self.view.bounds = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
- //
- // self.view.transform = CGAffineTransformMakeRotation(-M_PI*1.5);
- // }else
- // {
- // [[UIApplication sharedApplication] setStatusBarOrientation: UIInterfaceOrientationLandscapeRight animated: YES];
- // CGFloat duration = [UIApplication sharedApplication].statusBarOrientationAnimationDuration;
- // [UIView beginAnimations:nil context:nil];
- // [UIView setAnimationDuration:duration];
- // self.navigationController.view.transform = CGAffineTransformIdentity;
- // self.navigationController.view.transform = CGAffineTransformMakeRotation(M_PI*(90)/180.0);
- // self.navigationController.view.bounds = CGRectMake(0, 0, 480, 320);
- // [UIView commitAnimations];
- // }
- // [[NSNotificationCenter defaultCenter] postNotificationName:@"OnlyLandscape" object:@"SecondVC"];
- // CGFloat angle = 90;
- // self._vTransform.layer.transform = CATransform3DMakeRotation(angle*M_PI/180.0, 0, 0.0, 1.0);
- //设置旋转动画
- // self.navigationController.navigationBar.transform = CGAffineTransformMakeRotation(M_PI*1.5);
- //
- // //设置视图旋转
- //
- // self.view.bounds = CGRectMake(0, -54, self.view.frame.size.width, self.view.frame.size.height);
- //
- // self.view.transform = CGAffineTransformMakeRotation(-M_PI*1.5);
- //
- // [UIView commitAnimations];
- }
- - (void)didReceiveMemoryWarning
- {
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
- }
- // 大头贴的测试环境下
- - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orientation
- {
- // if ((orientation == UIInterfaceOrientationPortrait) ||
- // (orientation == UIInterfaceOrientationLandscapeLeft))
- // return YES;
- // if ((orientation == UIInterfaceOrientationLandscapeRight) ||
- // (orientation == UIInterfaceOrientationLandscapeLeft))
- // return YES;
- // else
- return NO;
- }
- //-(BOOL)shouldAutorotate
- //{
- // return YES;
- //}
- - (IBAction)backBtnClicked:(id)sender {
- // if ([[UIDevice currentDevice].systemVersion floatValue] >= 6.0) {
- // }else
- // {
- // [[UIApplication sharedApplication] setStatusBarOrientation: UIInterfaceOrientationLandscapeRight animated: YES];
- // CGFloat duration = [UIApplication sharedApplication].statusBarOrientationAnimationDuration;
- // [UIView beginAnimations:nil context:nil];
- // [UIView setAnimationDuration:duration];
- // self.navigationController.view.transform = CGAffineTransformIdentity;
- // self.navigationController.view.transform = CGAffineTransformMakeRotation(M_PI*(0)/180.0);
- // self.navigationController.view.bounds = CGRectMake(0, 0, 320, 480);
- // [UIView commitAnimations];
- // }
- [self.navigationController popToRootViewControllerAnimated:YES];
- }
- //-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
- //{
- // if (fromInterfaceOrientation == UIInterfaceOrientationMaskLandscape) {
- // NSLog(@"从横屏");
- // }else if (fromInterfaceOrientation == UIInterfaceOrientationMaskPortrait) {
- // NSLog(@"从肃屏");
- // }
- //}
- //-(NSUInteger)supportedInterfaceOrientations
- //{
- // return UIInterfaceOrientationMaskLandscape;
- //}
- //static bool is = NO;
- //- (void)orientationChanged:(NSNotification *)notification
- //{
- // UIDeviceOrientation deviceOrientation = [UIDevice currentDevice].orientation;
- // switch (deviceOrientation) {
- // case UIDeviceOrientationPortrait:
- // {
- //
- // }
- // break;
- // case UIDeviceOrientationLandscapeLeft:
- // {
- //
- // }
- // break;
- // case UIDeviceOrientationPortraitUpsideDown:
- // {
- //
- // }
- // break;
- // case UIDeviceOrientationLandscapeRight:
- // {
- // if (!is) {
- // //self._imgVBackground.frame = CGRectMake(0, 0, 480, 320);
- //// self.view.bounds = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
- //
- // self.view.transform = CGAffineTransformMakeRotation(M_PI*0.5);
- // is = YES;
- // }
- //
- // }
- // break;
- //
- // default:
- // break;
- // }
- //}
- //-(void)
- @end