I have a video application, but I would like it to remain only in landscape orientation.
When in a landscape it looks like this:

But when I turn around, he selects the portrait orientation and looks like this:

he would have stayed only in landscape orientation, had already tried and tried many things that I saw, and nothing worked, did someone help me?
[UPDATE]
You only need the view not to use the PORTRAIT orientation, did someone already have this problem?
Does anyone have any other ideas? nothing worked here
[UPDATE] → 09/30/2015
my decision:
in AppDelegate.m I use this:
-(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
if(self.restrictRotation == YES)
return UIInterfaceOrientationMaskLandscape;
else
return UIInterfaceOrientationMaskAll;
}
AppDelegate.h:
@property () BOOL restrictRotation;
where I want to stay only a landscape, I used it (videoViewController.m):
in viewDidLoad
[self restrictRotation:YES];
NSNumber *value = [NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight];
[[UIDevice currentDevice] setValue:value forKey:@"orientation"];
and add a method:
-(void) restrictRotation:(BOOL) restriction
{
AppDelegate* appDelegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
appDelegate.restrictRotation = restriction;
}
remember if #import "AppDelegate.h" in videoViewController.h
, , :
in viewDidLoad:
[self restrictRotation:YES]
:
-(void) restrictRotation:(BOOL) restriction
{
AppDelegate* appDelegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
appDelegate.restrictRotation = restriction;
}
! all