////AAAAVIEWCONTROLLER.M//HENGP////Created by Zhu Xinlei on 15/2/13.//Copyright (c) 2015 NIIT. All rights reserved.//#import "AAAAViewController.h"#import "AppDelegate.h"@interfaceAaaaviewcontroller ()@end@implementationAaaaviewcontroller- (ID) Initwithnibname: (NSString *) Nibnameornil Bundle: (NSBundle *) nibbundleornil{ Self=[Super Initwithnibname:nibnameornil Bundle:nibbundleornil]; if(self) {[self initview]; } returnSelf ;}-(void) initview{UIButton*bt=[[uibutton Alloc]initwithframe:cgrectmake ( -, -, -, the)]; [BT Settitle:@"return"Forstate:uicontrolstatenormal]; [BT Setbackgroundcolor:[uicolor Bluecolor]; [BT addtarget:self Action: @selector (back) forcontrolevents:uicontroleventtouchupinside]; [Self.view ADDSUBVIEW:BT]; Appdelegate*appdelegate=[[uiapplication Sharedapplication]Delegate]; [[UIApplication sharedapplication] Setstatusbarorientation:uideviceorientationlandscaperight Animated:YES]; CGFloat Duration=[UIApplication sharedapplication].statusbarorientationanimationduration; //Set rotation animation[UIView Beginanimations:nil Context:nil]; [UIView setanimationduration:duration]; //set the navigation bar rotationAppdelegate.nav.navigationBar.frame = CGRectMake (-204,224,480, +); Appdelegate.nav.navigationBar.transform= Cgaffinetransformmakerotation (m_pi*1.5); //set the view rotationSelf.view.bounds = CGRectMake (0, - Wu, Self.view.frame.size.width, self.view.frame.size.height); Self.view.transform= Cgaffinetransformmakerotation (m_pi*1.5); [Self setneedsstatusbarappearanceupdate]; [UIView commitanimations]; }-(uistatusbarstyle) preferredstatusbarstyle{returnuistatusbarstylelightcontent;}//-(BOOL) Prefersstatusbarhidden//For iOS7.0{ returnYES;}- (void) viewdidload {[Super viewdidload]; [Self.view Setbackgroundcolor:[uicolor Whitecolor]; }- (void) didreceivememorywarning {[Super didreceivememorywarning]; //Dispose of any resources the can be recreated.}-(void) back{appdelegate*appdelegate=[[uiapplication Sharedapplication]Delegate]; [Appdelegate.nav Popviewcontrolleranimated:yes];}/*#pragma mark-navigation//in a storyboard-based application, you'll often want to do a little preparation before n avigation-(void) Prepareforsegue: (Uistoryboardsegue *) Segue Sender: (ID) Sender {//Get the new view controller using [s] Egue Destinationviewcontroller]. Pass the selected object to the new view controller.}*/@end
IOS Force Horizontal Screen