user1525369
user1525369

Reputation:

Issue related landscape view in ios 7?

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

Answers (4)

user2071152
user2071152

Reputation: 1195

could you try this

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    if ((interfaceOrientation == UIInterfaceOrientationPortrait) || (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown)) {
        return NO;
    } else {
        return YES;
    }
}

Upvotes: 0

Shankar BS
Shankar BS

Reputation: 8402

try this way


- (BOOL)shouldAutorotate
 {
    return YES;
}

 - (NSUInteger)supportedInterfaceOrientations
 {
    return UIInterfaceOrientationMaskLandscapeLeft;

}

 - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
  return UIInterfaceOrientationLandscapeLeft;

}


Upvotes: 0

Manuel Escrig
Manuel Escrig

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

codercat
codercat

Reputation: 23271

-(BOOL) shouldAutorotate
{
    return YES;
}

Upvotes: 1

Related Questions