Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -(void)viewWillAppear:(BOOL)animated
- {
- self.navigationController.navigationBar.translucent = false;
- [self rotateController:self degrees:-90];
- [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeLeft animated:NO];
- }
- -(void)viewWillDisappear:(BOOL)animated{
- [super viewWillDisappear:animated];
- [self rotateController:self degrees:90];
- [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:NO];
- //set it according to 3.5 and 4.0 inch screen in protrait mode
- [self.view setBounds:CGRectMake(0, 0, 320, 480)];
- }
- -(void) rotateController:(UIViewController *)controller degrees:(NSInteger)aDgrees
- {
- controller.view.transform = CGAffineTransformConcat(controller.view.transform, CGAffineTransformMakeRotation(DEGREES_TO_RADIANS(aDgrees)));
- }
- - (BOOL)shouldAutorotate
- {
- //make view landscape on start
- return NO;
- }
- - (NSUInteger)supportedInterfaceOrientations
- {
- return UIInterfaceOrientationMaskLandscapeLeft;
- }
- - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
- {
- return UIInterfaceOrientationLandscapeLeft;
- }
- [self rotateController:self degrees:-90];
- [self rotateController:self.navigationController degrees:-90];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement