Reputation:
In my application support landscape orientation it working well in iOS 6. But in iOS 7 my device is change but self.view
is not supported landscape orientation why ?? anybody have faced same issue as mine ? then please help me at on.
my code of orientation is,
#pragma mark -
#pragma mark - Interface Orientation Delegate Methods
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if(interfaceOrientation == UIDeviceOrientationLandscapeLeft)
return YES;
return NO;
}
-(BOOL) shouldAutorotate
{
return NO;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeLeft;
}
Where i was wrong ??
Upvotes: 0
Views: 45
Reputation: 1195
could you try this
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if ((interfaceOrientation == UIInterfaceOrientationPortrait) || (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown)) {
return NO;
} else {
return YES;
}
}
Upvotes: 0
Reputation: 8402
try this way
- (BOOL)shouldAutorotate
{
return YES;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeLeft;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeLeft;
}
Upvotes: 0
Reputation: 2835
If you want the application to support both change the method
-(BOOL) shouldAutorotate
{
return NO;
}
to
- (BOOL)shouldAutorotate {
DebugLog(@"");
return YES;
}
Upvotes: 0